From 446f52f40bb4083e0e4e92de0442141a1d3d633d Mon Sep 17 00:00:00 2001 From: Graham Stott Date: Sat, 5 Jun 2004 07:59:39 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 59 ++++++++++++++++++++++++++++----------------------- gcc/combine.c | 8 ++++--- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4b1360aeec3..1e010f18dc7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,32 +1,37 @@ +2004-06-05 Graham Stott + + * combine.c(simplify_shift_const): Check shift amount is a + CONST_INT. + 2004-06-05 Danny Smith - * 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 diff --git a/gcc/combine.c b/gcc/combine.c index 64af27c779b..44ca720bc19 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; -- 2.30.2