https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116053
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |needs-bisection --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note I think a bisect here will just show where this latent bug shows up (GCC 13 register allocator gets it diffenent and uses the sp register as the address). I think after the call to df_analyze (that is in the loop) in pass_cprop_hardreg::execute we need to call purge_all_dead_edges. Or in df_analyze needs to call purge_dead_edge on the bb if it deletes an instruction with a REG_EH_REGION note on it. Note I do think we have a missed optimization at the gimple level. if the first argument to memset/memcpy is an ADDR_EXPR, we change the assignment. That is: x = *(__int128 *) __builtin_memset (&x, 0, 10); Should be done as: __builtin_memset (&x, 0, 10) x = *(__int128 *) &x; And then this will be optimized away earlier. Note this is a very much an artificial testcase and I highly doubt this will show up normally because -fnon-call-exceptions is not used that much and even less if fno-dead-exceptions.