aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Stott <grahams@gcc.gnu.org>2004-06-05 07:59:39 +0000
committerGraham Stott <grahams@gcc.gnu.org>2004-06-05 07:59:39 +0000
commit446f52f40bb4083e0e4e92de0442141a1d3d633d (patch)
tree90e178a8dd180582334958da2b47f629ea619198
parent90aa6719a03ca37a01bf94240dbf02fb4b1eb3e0 (diff)
downloadgcc-446f52f40bb4083e0e4e92de0442141a1d3d633d.zip
gcc-446f52f40bb4083e0e4e92de0442141a1d3d633d.tar.gz
gcc-446f52f40bb4083e0e4e92de0442141a1d3d633d.tar.bz2
combine.c (simplify_shift_const): Check shift amount is a CONST_INT.
* combine.c(simplify_shift_const): Check shift amount is a CONST_INT. From-SVN: r82644
-rw-r--r--gcc/ChangeLog59
-rw-r--r--gcc/combine.c8
2 files changed, 37 insertions, 30 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4b1360a..1e010f1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,32 +1,37 @@
+2004-06-05 Graham Stott <graham.stott@btinternet.com>
+
+ * combine.c(simplify_shift_const): Check shift amount is a
+ CONST_INT.
+
2004-06-05 Danny Smith <dannysmith@users.sourceforge.net>
- * toplev.c (init_asm_output): Add explicit 'b' to mode when
- opening asm_out_file.
- * c-pch.c (c_common_write_pch): Remove unnecessary fflush before
- reading asm_out_file. Replace fflush after reading asm_out_file
- with fseek.
- * hosthooks-def.h (HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY): Define
- default and add to HOST_HOOKS_INITIALIZER.
- * hosthooks.h (gt_pch_alloc_granularity): Declare hook function.
- * ggc-common.c (default_gt_pch_alloc_granularity): New function.
- (gt_pch_save): Use host_hooks.gt_pch_alloc_granularity
- to set mmi.offset padding.
- * config.gcc (i[34567]86-*-mingw32*): Set target_gtfiles to
- $(srcdir)/config/i386/winnt.c.
- (i[34567]86-*-pe | i[34567]86-*-cygwin*): Likewise.
- (i[34567]86-*-uwin*): Likewise.
- *i[34567]86-*-interix3*): Likewise.
- * config.host (i[34567]86-*-mingw32*): Set out_host_hook_obj.
- * config/i386/host-mingw32.c: New file.
- * config/i386/x-mingw32: Add rule for host-mingw32.o.
- * config/i386/winnt.c: (struct extern_list) Tag as GTY.
- (extern_head): Likewise.
- (struct export_list) Likewise.
- (export_head): Likewise.
- (i386_pe_record_external_function): Use ggc_alloc.
- (i386_pe_record_exported_symbol): Likewise.
- Include "gt-winnt.h" at end.
- * doc/hostconfig.texi: Document
+ * toplev.c (init_asm_output): Add explicit 'b' to mode when
+ opening asm_out_file.
+ * c-pch.c (c_common_write_pch): Remove unnecessary fflush before
+ reading asm_out_file. Replace fflush after reading asm_out_file
+ with fseek.
+ * hosthooks-def.h (HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY): Define
+ default and add to HOST_HOOKS_INITIALIZER.
+ * hosthooks.h (gt_pch_alloc_granularity): Declare hook function.
+ * ggc-common.c (default_gt_pch_alloc_granularity): New function.
+ (gt_pch_save): Use host_hooks.gt_pch_alloc_granularity
+ to set mmi.offset padding.
+ * config.gcc (i[34567]86-*-mingw32*): Set target_gtfiles to
+ $(srcdir)/config/i386/winnt.c.
+ (i[34567]86-*-pe | i[34567]86-*-cygwin*): Likewise.
+ (i[34567]86-*-uwin*): Likewise.
+ *i[34567]86-*-interix3*): Likewise.
+ * config.host (i[34567]86-*-mingw32*): Set out_host_hook_obj.
+ * config/i386/host-mingw32.c: New file.
+ * config/i386/x-mingw32: Add rule for host-mingw32.o.
+ * config/i386/winnt.c: (struct extern_list) Tag as GTY.
+ (extern_head): Likewise.
+ (struct export_list) Likewise.
+ (export_head): Likewise.
+ (i386_pe_record_external_function): Use ggc_alloc.
+ (i386_pe_record_exported_symbol): Likewise.
+ Include "gt-winnt.h" at end.
+ * doc/hostconfig.texi: Document
HOST_HOOKS_GT_PCH_ALLOC_GRANULARITY.
2004-06-04 Bernardo Innocenti <bernie@develer.com>
diff --git a/gcc/combine.c b/gcc/combine.c
index 64af27c..44ca720 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -8763,9 +8763,10 @@ simplify_shift_const (rtx x, enum rtx_code code,
logical expression, make a new logical expression, and apply
the inverse distributive law. This also can't be done
for some (ashiftrt (xor)). */
- if (code != ASHIFTRT || GET_CODE (varop)!= XOR
- || 0 <= trunc_int_for_mode (INTVAL (XEXP (varop, 1)),
- shift_mode))
+ if (GET_CODE (XEXP (varop, 1)) == CONST_INT
+ && !(code == ASHIFTRT && GET_CODE (varop) == XOR
+ && 0 > trunc_int_for_mode (INTVAL (XEXP (varop, 1)),
+ shift_mode)))
{
rtx lhs = simplify_shift_const (NULL_RTX, code, shift_mode,
XEXP (varop, 0), count);
@@ -8776,6 +8777,7 @@ simplify_shift_const (rtx x, enum rtx_code code,
varop = apply_distributive_law (varop);
count = 0;
+ continue;
}
break;