This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/29726] [4.2/4.3 regression] invalid folding of ((X >> C1) & C2) != 0 or "M-x is undefined" in emacs
- From: "christophe at saout dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Nov 2006 11:23:19 -0000
- Subject: [Bug middle-end/29726] [4.2/4.3 regression] invalid folding of ((X >> C1) & C2) != 0 or "M-x is undefined" in emacs
- References: <bug-29726-7958@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from christophe at saout dot de 2006-11-07 11:23 -------
The function "test" (even compiled with -O0, on i386 BTW) assumes that the
condition can never occur, as the complete if condition is completely optimized
away and the function always returns "1".
#include <stdlib.h>
int test(int x)
{
if (((unsigned int)x >> 3) & 0x08000000)
return 0;
return 1;
}
int main(void)
{
if (test(-1))
abort();
return 0;
}
--
christophe at saout dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |christophe at saout dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29726