re PR rtl-optimization/83147 (LRA inheritance undo on multiple sets problem)
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Fri, 19 Jan 2018 22:16:30 +0000 (22:16 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Fri, 19 Jan 2018 22:16:30 +0000 (22:16 +0000)
2018-01-19  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

PR rtl-optimization/83147
* lra-constraints.c (remove_inheritance_pseudos): Use
lra_substitute_pseudo_within_insn.

From-SVN: r256902

gcc/ChangeLog
gcc/lra-constraints.c

index 162ae1b1283f70efc7ded1906bfff5e022db09f6..8bffc6627d71dd95871b0e3b104f062b4d81b8ab 100644 (file)
@@ -1,3 +1,9 @@
+2018-01-19  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
+
+       PR rtl-optimization/83147
+       * lra-constraints.c (remove_inheritance_pseudos): Use
+       lra_substitute_pseudo_within_insn.
+
 2018-01-19  Tom de Vries  <tom@codesourcery.com>
            Cesar Philippidis  <cesar@codesourcery.com>
 
index 97a71030775640227033e17a5278e42bd54ecbf9..64ee2fec3c55920ed1ab4c4f6687af4288b0ae45 100644 (file)
@@ -6719,10 +6719,12 @@ remove_inheritance_pseudos (bitmap remove_pseudos)
                    {
                      lra_assert (GET_MODE (SET_SRC (prev_set))
                                  == GET_MODE (regno_reg_rtx[sregno]));
-                     if (GET_CODE (SET_SRC (set)) == SUBREG)
-                       SUBREG_REG (SET_SRC (set)) = SET_SRC (prev_set);
-                     else
-                       SET_SRC (set) = SET_SRC (prev_set);
+                     /* Although we have a single set, the insn can
+                        contain more one sregno register occurrence
+                        as a source.  Change all occurrences.  */
+                     lra_substitute_pseudo_within_insn (curr_insn, sregno,
+                                                        SET_SRC (prev_set),
+                                                        false);
                      /* As we are finishing with processing the insn
                         here, check the destination too as it might
                         inheritance pseudo for another pseudo.  */