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 tree-optimization/55883] New: with -fwrapv, (x < 0 && -x < 0) is assumed to be false


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55883

             Bug #: 55883
           Summary: with -fwrapv, (x < 0 && -x < 0) is assumed to be false
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: xi.wang@gmail.com


This is slightly different from Bug 22493.

#include <limits.h>
void abort ();
void f(int i)
{
  if (i<0 && -i<0)
    return;
  abort ();
}

int main(void)
{
  f(INT_MIN);
  return 0;
}

The program should not abort if compiled with -fwrapv.  4.7.2 and 4.6.3 seem to
miscompile it.  4.8 is good.


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