aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-12-11 18:42:41 -0800
committerRichard Henderson <rth@gcc.gnu.org>2001-12-11 18:42:41 -0800
commit0051b6cae4026eb737fbbce17aea5c699fff0677 (patch)
tree6a5218ac1eee7341319aa13211ef5f0e8cf3a7b1 /gcc
parentf3bfd09c28cee0b618ada98a97c864c242f46421 (diff)
downloadgcc-0051b6cae4026eb737fbbce17aea5c699fff0677.zip
gcc-0051b6cae4026eb737fbbce17aea5c699fff0677.tar.gz
gcc-0051b6cae4026eb737fbbce17aea5c699fff0677.tar.bz2
combine.c (simplify_shift_const): Move SHIFT_COUNT_TRUNCATED simplification above out of range check.
* combine.c (simplify_shift_const): Move SHIFT_COUNT_TRUNCATED simplification above out of range check. From-SVN: r47912
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/combine.c27
2 files changed, 18 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 48a09e5..981bcc3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-12-11 Richard Henderson <rth@redhat.com>
+
+ * combine.c (simplify_shift_const): Move SHIFT_COUNT_TRUNCATED
+ simplification above out of range check.
+
2001-12-11 Dan Nicolaescu <dann@ics.uci.edu>
* config/sparc/sparc.md (prefetch): New.
diff --git a/gcc/combine.c b/gcc/combine.c
index 0e15def..4a58e71 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -8811,15 +8811,14 @@ merge_outer_ops (pop0, pconst0, op1, const1, mode, pcomp_p)
are ASHIFTRT and ROTATE, which are always done in their original mode, */
static rtx
-simplify_shift_const (x, code, result_mode, varop, input_count)
+simplify_shift_const (x, code, result_mode, varop, orig_count)
rtx x;
enum rtx_code code;
enum machine_mode result_mode;
rtx varop;
- int input_count;
+ int orig_count;
{
enum rtx_code orig_code = code;
- int orig_count = input_count;
unsigned int count;
int signed_count;
enum machine_mode mode = result_mode;
@@ -8833,26 +8832,26 @@ simplify_shift_const (x, code, result_mode, varop, input_count)
int complement_p = 0;
rtx new;
+ /* Make sure and truncate the "natural" shift on the way in. We don't
+ want to do this inside the loop as it makes it more difficult to
+ combine shifts. */
+#ifdef SHIFT_COUNT_TRUNCATED
+ if (SHIFT_COUNT_TRUNCATED)
+ orig_count &= GET_MODE_BITSIZE (mode) - 1;
+#endif
+
/* If we were given an invalid count, don't do anything except exactly
what was requested. */
- if (input_count < 0 || input_count >= (int) GET_MODE_BITSIZE (mode))
+ if (orig_count < 0 || orig_count >= (int) GET_MODE_BITSIZE (mode))
{
if (x)
return x;
- return gen_rtx_fmt_ee (code, mode, varop, GEN_INT (input_count));
+ return gen_rtx_fmt_ee (code, mode, varop, GEN_INT (orig_count));
}
- count = input_count;
-
- /* Make sure and truncate the "natural" shift on the way in. We don't
- want to do this inside the loop as it makes it more difficult to
- combine shifts. */
-#ifdef SHIFT_COUNT_TRUNCATED
- if (SHIFT_COUNT_TRUNCATED)
- count %= GET_MODE_BITSIZE (mode);
-#endif
+ count = orig_count;
/* Unless one of the branches of the `if' in this loop does a `continue',
we will `break' the loop after the `if'. */