https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114317
--- Comment #2 from Jan Hubicka <hubicka at ucw dot cz> --- > (it would need to elide the stores of course). We do have way to elide stores, since we can optimize out write-only values. What we do not have readilly available is the value written to a reference (ipa-refs only connects variables/functions to statements that write/load/take address). I think the plan is to add summary template for references, like we have for callgraph edges and symbols. Then we can keep track of values and do optimizations like this. It is on my todo for quite some time ;)