------- Comment #4 from rguenth at gcc dot gnu dot org 2007-11-16 18:20 ------- Or rather a frontend bug if it doesn't promote either the integer to a pointer or the pointer to an integer:
./cc1 -quiet -O2 t.i -quiet t.i: In function foo: t.i:9: warning: comparison between pointer and integer ^^^^^^^ t.i:4: internal compiler error: in compare_values_warnv, at tree-vrp.c:701 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. with trunk we get if ((void *) (1 << mynum & (unsigned int) myvar) == 0B && mynum > 0) while with 4.2 we have if (((unsigned int) myvar >> mynum & 1) == 0B && mynum > 0) which hints at a fold bug again. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34030