summaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-11 08:11:52 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-11 08:11:52 +0000
commit45dc511c816a2b00ca3c2b8666eff2e80a82dc91 (patch)
treea6de3a8d010410ba2f310ee3377056ba4949dbf9 /gcc/ifcvt.c
parent168a134092f84f198f65002b4e0942f9cecee77f (diff)
downloadgcc-45dc511c816a2b00ca3c2b8666eff2e80a82dc91.tar.gz
2016-02-11 Richard Biener <rguenther@suse.de>
PR rtl-optimization/69291 * ifcvt.c (noce_try_store_flag_constants): Do not allow subexpressions affected by changing the result. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233316 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index a50e33dc66c..205590938a5 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -1274,7 +1274,10 @@ noce_try_store_flag_constants (struct noce_if_info *if_info)
&& CONST_INT_P (XEXP (a, 1))
&& CONST_INT_P (XEXP (b, 1))
&& rtx_equal_p (XEXP (a, 0), XEXP (b, 0))
- && noce_operand_ok (XEXP (a, 0))
+ /* Allow expressions that are not using the result or plain
+ registers where we handle overlap below. */
+ && (REG_P (XEXP (a, 0))
+ || ! reg_overlap_mentioned_p (if_info->x, XEXP (a, 0)))
&& if_info->branch_cost >= 2)
{
common = XEXP (a, 0);