http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49330
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Status|UNCONFIRMED |NEW Last reconfirmed| |2011.06.09 09:36:46 CC| |ebotcazou at gcc dot | |gnu.org Component|c |rtl-optimization Ever Confirmed|0 |1 Known to fail| |4.3.5, 4.4.5, 4.5.3, 4.6.0, | |4.7.0 --- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-06-09 09:36:46 UTC --- I can confirm the original testcase with r173419 (not the one from comment#1). The tree level optimizers handle this ok and we expand from <bb 2>: px_1 = (uintptr_t) &x; py_2 = (uintptr_t) &y; d.0_3 = px_1 - py_2; d ={v} d.0_3; d.1_4 ={v} d; p_5 = d.1_4 + py_2; x = 1; # PT = { x y } (glob) p.2_6 = (int *) p_5; *p.2_6 = 2; D.2722_7 = x; return D.2722_7; where you can also see that we correctly assume that p.2_6 may point either x or y. CSE1 optimizes the load from x to 1.