https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79578
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Target| |x86_64-*-*, i?86-*-* Status|UNCONFIRMED |NEW Last reconfirmed| |2017-02-17 CC| |law at gcc dot gnu.org Component|c++ |tree-optimization Ever confirmed|0 |1 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- Note that appearantly b is allowed to be NULL. Confirmed for the partial dead code elimination issue. tree DSE sees <bb 2> [100.00%]: if (b_3(D) != 0B) goto <bb 3>; [0.00%] else goto <bb 4>; [0.00%] <bb 3> [0.00%]: MEM[(struct A *)b_3(D)] = {}; <bb 4> [0.00%]: MEM[(struct A *)b_3(D)].a = 1; MEM[(struct A *)b_3(D)].b = 2; return b_3(D); and after store-merging we have (no further DSE): <bb 2> [100.00%]: if (b_2(D) != 0B) goto <bb 3>; [73.26%] else goto <bb 4>; [26.74%] <bb 3> [73.26%]: MEM[(struct A *)b_2(D)] = {}; <bb 4> [100.00%]: MEM[(short unsigned int *)b_2(D)] = 131073; return b_2(D); Jeff -- wasn't your "partial DSE" supposed to help here? Ah, it was to trim partial stores rather than full stores followed by partial ones making it dead?