aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/simplify-rtx.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 020a00c..d318d58 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-11-16 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR rtl-optimization/68330
+ * simplify-rtx.c (simplify_unary_operation_1): Simplify SIGN_EXTEND
+ of LSHIFTRT by a non-zero constant integer.
+
2015-11-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/68306
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index c4fc42a..413d61b 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -1462,6 +1462,13 @@ simplify_unary_operation_1 (enum rtx_code code, machine_mode mode, rtx op)
}
}
+ /* (sign_extend:M (lshiftrt:N <X> (const_int I))) is better as
+ (zero_extend:M (lshiftrt:N <X> (const_int I))) if I is not 0. */
+ if (GET_CODE (op) == LSHIFTRT
+ && CONST_INT_P (XEXP (op, 1))
+ && XEXP (op, 1) != const0_rtx)
+ return simplify_gen_unary (ZERO_EXTEND, mode, op, GET_MODE (op));
+
#if defined(POINTERS_EXTEND_UNSIGNED)
/* As we do not know which address space the pointer is referring to,
we can do this only if the target does not support different pointer