> I'm completely unsurprised this is broken at the tree level given how > it is implemented
Nice tautology. :-) You have resisted implementing anything at the tree level to fix the problem and now you're complaining there is a problem... Let's try and devise something plausible at the tree level. If we eventually fail, we could indeed consider disabling the optimization at the RTL level. -- Eric Botcazou