[Bug optimization/11557] New: [3.3 regression] constant folding
gbeauchesne at mandrakesoft dot com
gcc-bugzilla@gcc.gnu.org
Thu Jul 17 09:24:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11557
Summary: [3.3 regression] constant folding
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: gbeauchesne at mandrakesoft dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-linux-gnu
The following testcase fails at -O & -O2. This is a regression from 3.2.3
present on all 3.3 branches (2003/07/16) and at least AMD64 & IA-32. At this
optimization level i == 0 is assumed and only a call to zero() is generated.
extern void abort (void);
int zero (void)
{
return 0;
}
int one (void)
{
return 1;
}
int main (void)
{
int i = 1;
int r = (i ? one : zero)();
if (r != 1)
abort();
return 0;
}
More information about the Gcc-bugs
mailing list