https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64319
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |alias, missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2014-12-16 Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- The interesting problem to solve is of course which disabiguation checks to insert (and where). And whether there is really a net positive effect in runtime (surley not code-size). Probably making this a value-profiling would make sense? As for the missed optimization with the conditonal code here the issue is that points-to information is not flow-sensitive (or rather only in sofar as SSA defs are flow-sensitive). <bb 2>: if (a_3(D) == b_4(D)) goto <bb 3>; else goto <bb 4>; ... <bb 4>: *a_3(D) = 1; _12 = *b_4(D); _13 = _12 + 1; *b_4(D) = _13; _15 = *a_3(D); And of course our points-to code doesn't look at conditionals at all to derive alias information (it couldn't associate it with SSA names later anyway). It would need to add explicit IL similar to VRP (but that does it only temporarily), and it also would require to teach the solver of a constraint that makes two pointers non-equal (not sure if doable at all). For the a == b case we manage to copy-propagate both to equal values in DOM and thus optimize the loads and later DSE the redundant store. We could use the recently added facility to record explicit non-dependences which is also flow-sensitive (recorded on actual memory references) when adding the alias check or from code (DOM?) that figures out non-equivalence. [see MR_DEPENDENCE_CLIQE / MR_DEPENDENCE_BASE] I see this as two bugs - one to generate runtime disambiguation code, possibly directed by profiling, and one to actually make use of present runtime alias checks. Confirmed.