https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113372
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #6) > So, couldn't we attempt at least a partial workaround at add_scope_conflicts > time? > I mean, for SSA_NAME uses in statements with some caching try to check if > those SSA_NAMEs may contain addresses (or because of ivopts also in > pointer-sized integers) of particular DECL_RTL_IF_SET (op) == pc_rtx vars or > set of them and treat those as if they were the addresses too? > I mean where we call walk_stmt_load_store_addr_ops also check uses of > SSA_NAMEs which are based on those ADDR_EXPRs and treat those similarly. > It wouldn't handle say const or pure functions taking address of some var > and say returning something based on it, but perhaps could workaround the > most common issues in the wild with stack sharing. I belive we investigated such workarounds but they didn't seem to work? Other cases are concerned with address uses before loops (I think they start lifetime "correctly" now) but CLOBBERs ending lifetime inside the loop. The dataflow problem then is confused with the backedge having the object not live IIRC. So what would your workaround do? Not handle address mentions as starting live but only its (possible) memory uses?