This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/11557] New: [3.3 regression] constant folding
- From: "gbeauchesne at mandrakesoft dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jul 2003 09:24:54 -0000
- Subject: [Bug optimization/11557] New: [3.3 regression] constant folding
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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;
}