static const float a = 0.299f; static const float b = 0.114f; static const float c = 1 - a - c;
float foo (void) { return a + b + c; } ICEs at -O and higher. There is a typo (should have been 1 - a - b of course), but IMHO that just triggers undefined behavior. G++ 4.0.x would initialize c in __static_initialization_and_destruction_0(int, int) and compile it without ICE, where foo would be return 0.413f + c; In 4.1.0+, apparently c is initialized to error_mark_node, although no error nor even a warning is emitted at compile time, and obviously various later optimizers are upset when seeing error_mark_node on unexpected places, errorneous input is not supposed to reach that far ever. -- Summary: [4.1/4.2 Regression] ICE in get_expr_operands Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27129