------- Comment #10 from vda dot linux at googlemail dot com  2008-08-04 11:55 
-------
Created an attachment (id=16012)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16012&action=view)
Testcase to be added to testsuite

This program is artificially made to not compile if VRP fails
to predict a range:

  if (a < 0x1000) return;
  if (a > 0x1000) return;
  if (b < 0x0110) return;
  if (!__builtin_constant_p ((a|b) >= 0x01000))
    asm("the.bug.is.here");

Before this patch, gcc will fail to see that (a|b) >= 0x01000 is known at
compile time, after it it will see that.

I don't know how to conditionally check for -O (not -O2 or -Os, just -O).
#if defined __OPTIMIZE__ means "-O<anything>", I need to check for
"-O<anything> but not bare -O". Help.
Currently gcc -O -c pr28632.c fails (-O level is not high enough to trigger
VRP).


-- 


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

Reply via email to