summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2013-12-10 22:58:37 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2013-12-10 22:58:37 +0000
commit808c43038cdaaa1ad1a719a9027c8a5250a40c54 (patch)
treeb0155eff0eedb02194531ea371f532b7ed7f67d5 /gcc/simplify-rtx.c
parent688974a346b1f73cbf94ebe0ca95f4690a7f922b (diff)
downloadgcc-808c43038cdaaa1ad1a719a9027c8a5250a40c54.tar.gz
re PR rtl-optimization/58295 (Missed zero-extension elimination in the combiner)
PR rtl-optimization/58295 * simplify-rtx.c (simplify_truncation): Restrict the distribution for WORD_REGISTER_OPERATIONS targets. From-SVN: r205874
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c15
1 files changed, 10 insertions, 5 deletions
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)