http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52558
--- Comment #15 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-11 08:15:40 UTC --- (In reply to comment #14) > Richard G., or perhaps another aliasing expert. I am working on a patch for > this problem. Could you pontificate as to why no optimization pass has been > able to figure out that g_2_lsm.6_12 == g_2 below? > > # VUSE <.MEM_9(D)> > g_2_lsm.6_12 = g_2; <-- g_2_lsm set to g_2 > if (pretmp.4_1 != 0) > goto <bb 3>; > else > goto <bb 5>; > > <bb 3>: > # VUSE <.MEM_9(D)> > D.1883_17 = g_2; > if (g_2_lsm.6_12 != D.1883_17) <-- g_2_lsm compared with g_2 > goto <bb 4>; > > Why can't anyone figure out that g_2_lsm is g_2? Am I building the conditions > and stores incorrectly, is there a missing annotation, or is something else > amok here? Both value-numbering (FRE/PRE, that do not run after store motion :/) and DOM should figure this out. DOM only in theory, but at least in this simple case it should figure it out. Do you have a testcase that does not require your patches? > Thanks.