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

--- Comment #10 from denisc at gcc dot gnu.org ---
Proposed patch.

I just mark a CLOBBER insn with pseudo spilled to memory for removing it later
together with LRA temporary CLOBBER insns.

The patch is simple.
On x86_64, it bootstraps+regtests fine.

        PR rtl-optimization/117191
gcc/
        * lra-spills.cc (spill_pseudos): Mark a CLOBBER insn with pseudo
        spilled to memory for removing it later together with LRA temporary
        CLOBBER insns.


diff --git a/gcc/lra-spills.cc b/gcc/lra-spills.cc
index c149c3388cd..3f5c8d2bcb0 100644
--- a/gcc/lra-spills.cc
+++ b/gcc/lra-spills.cc
@@ -537,6 +537,11 @@ spill_pseudos (void)
                      break;
                    }
                }
+             if (GET_CODE (PATTERN (insn)) == CLOBBER)
+               /* This is a CLOBBER insn with pseudo spilled to memory.
+                  Mark it for removing it later together with LRA temporary
+                  CLOBBER insns.  */
+               LRA_TEMP_CLOBBER_P (PATTERN (insn)) = 1;
              if (lra_dump_file != NULL)
                fprintf (lra_dump_file,
                         "Changing spilled pseudos to memory in insn #%u\n",

Reply via email to