This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/27129] New: [4.1/4.2 Regression] ICE in get_expr_operands
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Apr 2006 09:43:49 -0000
- Subject: [Bug c++/27129] New: [4.1/4.2 Regression] ICE in get_expr_operands
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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