Skip to content

GDALCachedPixelAccessor: avoid GCC 13.1 ICE in C++20 - #15440

Open
jmcarcell wants to merge 2 commits into
OSGeo:masterfrom
jmcarcell:fix-gcc13-cached-pixel-accessor
Open

jmcarcell wants to merge 2 commits into
OSGeo:masterfrom
jmcarcell:fix-gcc13-cached-pixel-accessor

Conversation

@jmcarcell

@jmcarcell jmcarcell commented Oct 26, 2026 •

Copy link
Copy Markdown

What does this PR do?

Explicitly default CachedTile's constructor to avoid a GCC 13.1.0 internal compiler error when initializing m_aCachedTiles in C++20 mode. The existing member initializers still initialize each tile.

Building GDAL 3.13.3 on AlmaLinux 9 with GCC 13.1.0 fails in alg/gdalgeoloc.cpp, instantiating GDALCachedPixelAccessor<double, 256, 64>:

gcore/gdalcachedpixelaccessor.h:51:9: internal compiler error: Segmentation fault
   51 |         m_aCachedTiles{};

The failure also reproduces in a standalone example containing just the nested tile type and its array. It occurs in C++20 mode, but passes in C++17. In our build, PROJ 9.9.0 exports cxx_std_20, raising GDAL's effective standard above the requested C++17.

Validation on the 3.13.3 release:

  • Clean GCC 13.1.0 Debug package build: reproduced before the change; build and installation pass after it.
  • Forward/inverse geolocation smoke checks pass with GDAL_GEOLOC_USE_TEMP_DATASETS=NO and YES, including the affected dataset accessor.
  • The unmodified standalone example passes with GCC 14.2.0 and 16.1.0 in C++20 mode.

AI tool usage

  • Codex reproduced the failure, proposed this change, ran the validation, and prepared and submitted this PR at the user's explicit request.

Environment

  • AlmaLinux 9, x86_64
  • GCC 13.1.0, C++20

Default the nested tile constructor to avoid the aggregate initialization path that crashes GCC 13.1.0. Existing member initializers retain the same tile state.

AI assistance: Codex proposed this change, performed validation, and prepared this commit at the user’s request.
Comment thread gcore/gdalcachedpixelaccessor.h Outdated

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant