https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114284

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Perhaps we should simply punt on trying to propagate src which is MEM or
contains MEM anywhere in it unless likely_profitable_p ().
--- gcc/fwprop.cc.jj    2024-03-08 09:07:29.371626376 +0100
+++ gcc/fwprop.cc       2024-03-08 16:18:16.125853619 +0100
@@ -451,6 +451,7 @@ try_fwprop_subst_pattern (obstack_waterm

   if (!prop.likely_profitable_p ()
       && (prop.changed_mem_p ()
+         || contains_mem_rtx_p (src)
          || use_insn->is_asm ()
          || !single_set (use_rtl)))
     {
That will ensure we honor the classify_result decisions if MEMs are being
propagated (so pretty much restore previous behavior in that case).

Reply via email to