aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop-iv.c
diff options
context:
space:
mode:
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>2013-03-20 13:24:12 +0000
committerWilliam Schmidt <wschmidt@gcc.gnu.org>2013-03-20 13:24:12 +0000
commitcca1130d11997d40bd37603fab5953ccf8061331 (patch)
tree8d09c10eb8fe0b0c3a6649a5f43982ffed087631 /gcc/loop-iv.c
parent818d4efaa751bfe0f2a69edfb3eeb5a3a0877b63 (diff)
downloadgcc-cca1130d11997d40bd37603fab5953ccf8061331.zip
gcc-cca1130d11997d40bd37603fab5953ccf8061331.tar.gz
gcc-cca1130d11997d40bd37603fab5953ccf8061331.tar.bz2
re PR rtl-optimization/56605 (Redundant branch introduced during loop2 phases)
gcc: 2013-03-13 Bill Schmidt <wschmidt@linux.vnet.ibm.com> Steven Bosscher <steven@gcc.gnu.org> PR rtl-optimization/56605 * loop-iv.c (implies_p): Handle equal RTXs and subregs. gcc/testsuite: 2013-03-13 Bill Schmidt wschmidt@linux.vnet.ibm.com> PR rtl-optimization/56605 * gcc.target/powerpc/pr56605.c: New. Co-Authored-By: Steven Bosscher <steven@gcc.gnu.org> From-SVN: r196823
Diffstat (limited to 'gcc/loop-iv.c')
-rw-r--r--gcc/loop-iv.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index 15f1661..0847307 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -1496,19 +1496,26 @@ implies_p (rtx a, rtx b)
rtx op0, op1, opb0, opb1, r;
enum machine_mode mode;
+ if (rtx_equal_p (a, b))
+ return true;
+
if (GET_CODE (a) == EQ)
{
op0 = XEXP (a, 0);
op1 = XEXP (a, 1);
- if (REG_P (op0))
+ if (REG_P (op0)
+ || (GET_CODE (op0) == SUBREG
+ && REG_P (SUBREG_REG (op0))))
{
r = simplify_replace_rtx (b, op0, op1);
if (r == const_true_rtx)
return true;
}
- if (REG_P (op1))
+ if (REG_P (op1)
+ || (GET_CODE (op1) == SUBREG
+ && REG_P (SUBREG_REG (op1))))
{
r = simplify_replace_rtx (b, op1, op0);
if (r == const_true_rtx)