------- Comment #4 from rguenth at gcc dot gnu dot org 2010-02-27 21:33 ------- This is because
p = 0; is not detected as dead store by tree DSE as in p = 0; r = *q; p = (T *) t[0]; *q may load from p because with LTO TBAA rules for pointers have been relaxed (for a reason but also in a somewhat simple manner). With non-LTO void * and void ** have different alias-sets, with LTO they do not (as especially mismatching void * and void ** is a very common error that would lead to many spurious miscompiles with LTO). Note that we really can't optimize this testcase without using TBAA and by design we do not. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Keywords| |alias Resolution| |WONTFIX http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43201