The attached simple test case crashes when compiled with g++ but not with gcc. Version 4.4.3 of g++ emits the "'<anonymous>' may be used uninitialized" warning.
The program works fine when one unreachable line is removed from the program. It seems that the compiler generates incorrect code when the unreachable line is present. The program also works if optimization is enabled, presumably because it optimizes away the unreachable line. g++ -Wall -g -o gccmultidimarray gccmultidimarray.c -- Summary: questionable "'<anonymous>' may be used uninitialized" warning and code failure Product: gcc Version: 4.4.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bgreen at nas dot nasa dot gov GCC target triplet: x86_64-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44851