]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR rtl-optimization/57003 (gcc breaks -O2 optimization with Wine(64...
authorUros Bizjak <ubizjak@gmail.com>
Thu, 9 Oct 2014 09:05:37 +0000 (11:05 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 9 Oct 2014 09:05:37 +0000 (11:05 +0200)
Backport from mainline
2014-10-09  Uros Bizjak  <ubizjak@gmail.com>

PR rtl-optimization/57003
* regcprop.c (copyprop_hardreg_forward_1): If ksvd.ignore_set_reg,
also check CALL_INSN_FUNCTION_USAGE for clobbers again after
killing regs_invalidated_by_call.

From-SVN: r216035

gcc/ChangeLog
gcc/regcprop.c

index c53278cc70e2fd825b16b978372ce8a62e05252f..e7dc0f3e2f76e7eb16ab2b16df6723650edd82d5 100644 (file)
@@ -1,3 +1,13 @@
+2014-10-09  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline
+       2014-10-09  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR rtl-optimization/57003
+       * regcprop.c (copyprop_hardreg_forward_1): If ksvd.ignore_set_reg,
+       also check CALL_INSN_FUNCTION_USAGE for clobbers again after
+       killing regs_invalidated_by_call.
+
 2014-10-08  Oleg Endo  <olegendo@gcc.gnu.org>
 
        Backport from mainline
index 8bfb64e40cb540c978d34890ee9bd356175c729f..5b785116aaddbbf2c09469a6ef3ca8c220ef7f25 100644 (file)
@@ -1039,7 +1039,17 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
             but instead among CLOBBERs on the CALL_INSN, we could wrongly
             assume the value in it is still live.  */
          if (ksvd.ignore_set_reg)
-           note_stores (PATTERN (insn), kill_clobbered_value, vd);
+           {
+             note_stores (PATTERN (insn), kill_clobbered_value, vd);
+             for (exp = CALL_INSN_FUNCTION_USAGE (insn);
+                  exp;
+                  exp = XEXP (exp, 1))
+               {
+                 rtx x = XEXP (exp, 0);
+                 if (GET_CODE (x) == CLOBBER)
+                   kill_value (SET_DEST (x), vd);
+               }
+           }
        }
 
       /* Notice stores.  */