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 middle-end/29726] [4.2/4.3 regression] invalid folding of ((X >> C1) & C2) != 0 or "M-x is undefined" in emacs



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


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