summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-04 21:04:54 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-04 21:04:54 +0000
commit9a1ba33e28ccfe26dd3d875d476833c164164729 (patch)
treee6584beeae32a98e8799d34bffe88039b8b8e8e0 /gcc/combine.c
parent0ed407e4eea0664d140ba9ef4ad22dde797c49c6 (diff)
downloadgcc-9a1ba33e28ccfe26dd3d875d476833c164164729.tar.gz
PR rtl-optimization/49619
* combine.c (combine_simplify_rtx): In PLUS -> IOR simplification pass VOIDmode as op0_mode to recursive call, and return temp even when different from tor, just if it is not IOR of the original PLUS arguments. * gcc.dg/pr49619.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175825 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 56fb44eaf42..ba35f280fcd 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -5681,12 +5681,17 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest,
{
/* Try to simplify the expression further. */
rtx tor = simplify_gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1));
- temp = combine_simplify_rtx (tor, mode, in_dest, 0);
+ temp = combine_simplify_rtx (tor, VOIDmode, in_dest, 0);
/* If we could, great. If not, do not go ahead with the IOR
replacement, since PLUS appears in many special purpose
address arithmetic instructions. */
- if (GET_CODE (temp) != CLOBBER && temp != tor)
+ if (GET_CODE (temp) != CLOBBER
+ && (GET_CODE (temp) != IOR
+ || ((XEXP (temp, 0) != XEXP (x, 0)
+ || XEXP (temp, 1) != XEXP (x, 1))
+ && (XEXP (temp, 0) != XEXP (x, 1)
+ || XEXP (temp, 1) != XEXP (x, 0)))))
return temp;
}
break;