https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #9) > Created attachment 46312 [details] > gcc10-pr90348.patch > > Untested patch that implements what was written in #c5. I agree that > without further changes to the IL, determining if one can hoist addresses of > local variables or not is going to be hard, would require computing the > variable life info in each pass that would do something similar. On the > other side, admittedly such hoisting results in worse code generation > because if the address is hoisted earlier than where it used to be live > before, then there will be more stack conflicts. Ick. You need to handle pt->anything and pt->escaped (walk the escaped solution) as well. And !SSA_NAME_PTR_INFO (op) is of course the same as pt->anything. I see it quickly degrading given the last PTA compute is far far away...