This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/28632] VRP should understand bitwise OR and AND
- From: "vda dot linux at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Aug 2008 11:55:17 -0000
- Subject: [Bug tree-optimization/28632] VRP should understand bitwise OR and AND
- References: <bug-28632-12956@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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