------- Comment #7 from rguenth at gcc dot gnu dot org 2008-09-18 08:57 ------- Well ... VRP validly asserts that i_7 is not NULL after dereferencing it:
<bb 3>: # i_2 = PHI <4094B(2), i_20(8)> # sum_1 = PHI <0(2), sum_9(8)> i_7 = i_2 + -4; D.1209_8 = *i_7; i_20 = ASSERT_EXPR <i_7, i_7 != 0B>; sum_9 = D.1209_8 + sum_1; if (i_20 != 0B) goto <bb 8>; else goto <bb 4>; <bb 8>: goto <bb 3>; which makes it optimize the check for i_20 != NULL to true. You can work around this with -fno-delete-null-pointer-checks, but frankly in a hosted i686-pc-cygwin environment the code is just broken. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37569