------- Comment #5 from manu at gcc dot gnu dot org 2009-08-03 14:07 ------- (In reply to comment #3) > Created an attachment (id=18289) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18289&action=view) [edit] > gcc45-pr40943.patch > > Untested fix. It breaks uninit-6*.c again though, but "fixing" this kind of > false positive by simply disabling uninitialized warnings for all pointer > dereferences on LHS is IMHO too big hammer. >
I was testing the exactly same patch, you posted first, so the honor is yours. :-) Notice that you should not need -O2 for testing this. The testcase should work even with -O0. Notice that uninit-6 is a missed optimization. Even with -O2, the unreachable use of field is still present in the code shown by uninit-6-O0.c.136t.optimized, so it seems the tree optimizers do not handle this case. My patch only hide the symptom (the warning) but the missed optimization was still there so we could xfail it again. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40943