This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/11557] New: [3.3 regression] constant folding


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;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]