https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69155
--- Comment #7 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> --- (In reply to Richard Biener from comment #6) > (In reply to Jakub Jelinek from comment #4) > > (In reply to Richard Biener from comment #2) > > > I think we have a dup/related bug where we run into the issue that > > > tree-complex.c > > > wrecks SSA form during its rewrite. > > > > That is indeed what happens, but what solution do you see other than > > avoiding all the simplifications/optimizations that follow ssa edges? > > In the other bug we discussed to do the processing in proper (dominator) > order. Richard, any progress on that? Sorry for dropping the ball on this. I'd hit exactly the problem that Jakub described and wasn't sure how to proceed. Walking in dominator order or reserve postorder doesn't help because we still need to create scalar SSA_NAME replacements for complex phis. You then have the same problem for the definitions of the phi in cases where an argument comes from a backedge. It seemed like we'd need to do one of: - initially make the scalar definition a GIMPLE_NOP and replace it with a phi later once we've decomposed all arguments - initially make the scalar definition an empty phi and fill in its arguments later - initially make the scalar definition an empty phi and fill in arguments as soon as their value is known. None of them seemed very appealing. Like Jakub says, I'm worried that any incomplete definitions are going to cause problems with code making invalid assumptions. In some ways having a null DEF_STMT seems like the clearest indication of what's going on.