summaryrefslogtreecommitdiffstats
path: root/gcc
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-10 22:58:37 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-10 22:58:37 +0000
commit0971524ec03d8d070a4ceb03d69827e81fd14788 (patch)
treeb0155eff0eedb02194531ea371f532b7ed7f67d5 /gcc
parent13b69234b1b9e3d6b1f602bc03c5fafc3f97a4c8 (diff)
downloadppe42-gcc-0971524ec03d8d070a4ceb03d69827e81fd14788.tar.gz
ppe42-gcc-0971524ec03d8d070a4ceb03d69827e81fd14788.zip
PR rtl-optimization/58295
* simplify-rtx.c (simplify_truncation): Restrict the distribution for WORD_REGISTER_OPERATIONS targets. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205874 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/simplify-rtx.c15
2 files changed, 16 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3264f7ab92a..d9f27b911a1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2013-12-10 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR rtl-optimization/58295
+ * simplify-rtx.c (simplify_truncation): Restrict the distribution for
+ WORD_REGISTER_OPERATIONS targets.
+
2013-12-10 Richard Sandiford <rdsandiford@googlemail.com>
* genrecog.c (validate_pattern): Treat all messages except missing
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index ec138584c38..78cd665e9a8 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -640,11 +640,16 @@ simplify_truncation (enum machine_mode mode, rtx op,
XEXP (op, 0), origmode);
}
- /* Simplify (truncate:SI (op:DI (x:DI) (y:DI)))
- to (op:SI (truncate:SI (x:DI)) (truncate:SI (x:DI))). */
- if (GET_CODE (op) == PLUS
- || GET_CODE (op) == MINUS
- || GET_CODE (op) == MULT)
+ /* If the machine can perform operations in the truncated mode, distribute
+ the truncation, i.e. simplify (truncate:QI (op:SI (x:SI) (y:SI))) into
+ (op:QI (truncate:QI (x:SI)) (truncate:QI (y:SI))). */
+ if (1
+#ifdef WORD_REGISTER_OPERATIONS
+ && precision >= BITS_PER_WORD
+#endif
+ && (GET_CODE (op) == PLUS
+ || GET_CODE (op) == MINUS
+ || GET_CODE (op) == MULT))
{
rtx op0 = simplify_gen_unary (TRUNCATE, mode, XEXP (op, 0), op_mode);
if (op0)
OpenPOWER on IntegriCloud