cselib: Mark the cselib_record_sp_cfa_base_equiv VALUE as preserved [PR94551]
authorJakub Jelinek <jakub@redhat.com>
Sat, 11 Apr 2020 05:32:12 +0000 (07:32 +0200)
committerJakub Jelinek <jakub@redhat.com>
Sat, 11 Apr 2020 05:34:38 +0000 (07:34 +0200)
Sometimes the cselib_record_sp_cfa_base_equiv makes it into the var-tracking
used VALUEs and needs to be preserved.

2020-04-11  Jakub Jelinek  <jakub@redhat.com>

PR debug/94495
PR target/94551
* cselib.c (cselib_record_sp_cfa_base_equiv): Set PRESERVED_VALUE_P on
val->val_rtx.

gcc/ChangeLog
gcc/cselib.c

index 33e980bd977a5775afc83e4b04de44356c8a22ed..f1a9568d9c4c040f7b7be804a7df3c46fbbb03ad 100644 (file)
@@ -1,3 +1,10 @@
+2020-04-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/94495
+       PR target/94551
+       * cselib.c (cselib_record_sp_cfa_base_equiv): Set PRESERVED_VALUE_P on
+       val->val_rtx.
+
 2020-04-10  Thomas Schwinge  <thomas@codesourcery.com>
 
        PR middle-end/89433
index 3692feb13a2d2f1829773ad03c9ffffdf4552bdf..53e9603868dc27daa8f8535ec4bc6a05f0945e71 100644 (file)
@@ -2695,7 +2695,10 @@ cselib_record_sp_cfa_base_equiv (HOST_WIDE_INT offset, rtx_insn *insn)
     = cselib_lookup_from_insn (plus_constant (Pmode, sp_derived_value, offset),
                               Pmode, 1, VOIDmode, insn);
   if (val != NULL)
-    cselib_record_set (stack_pointer_rtx, val, NULL);
+    {
+      PRESERVED_VALUE_P (val->val_rtx) = 1;
+      cselib_record_set (stack_pointer_rtx, val, NULL);
+    }
 }
 
 /* Return true if V is SP_DERIVED_VALUE_P (or SP_DERIVED_VALUE_P + CONST_INT)