From: Uros Bizjak Date: Thu, 9 Oct 2014 09:05:37 +0000 (+0200) Subject: backport: re PR rtl-optimization/57003 (gcc breaks -O2 optimization with Wine(64... X-Git-Tag: releases/gcc-4.8.4~182 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7812e36a0dc8b525323463b152096b65b26429df;p=thirdparty%2Fgcc.git backport: re PR rtl-optimization/57003 (gcc breaks -O2 optimization with Wine(64) - links/info/bisect of commits included) Backport from mainline 2014-10-09 Uros Bizjak 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c53278cc70e2..e7dc0f3e2f76 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2014-10-09 Uros Bizjak + + Backport from mainline + 2014-10-09 Uros Bizjak + + 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 Backport from mainline diff --git a/gcc/regcprop.c b/gcc/regcprop.c index 8bfb64e40cb5..5b785116aadd 100644 --- a/gcc/regcprop.c +++ b/gcc/regcprop.c @@ -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. */