https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102703
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Aldy Hernandez from comment #9) > Also, if we did have cleaner IL, we could probably tweak the threader to > elide the call to foo() earlier. That is, without having to resort to help > from the RTL optimizers. Right which is why I had wrote: > Maybe we need a quick DCE sometime right after forwprop2? Another way to do the cleanup is when the store is removed when detected it was a write only store, also remove the definiving SSA_NAME what was used for the store's rhs (if it was only used in that statement). I could not figure out which pass removed that but let me see if I can figure that out and it should help here (and others). > As usual, thanks for narrowing all these bug reports. It makes a big > difference, and your presence during bug hunting season is always a big plus.