combine.c (simplify_shift_const): Check shift amount is a CONST_INT.
authorGraham Stott <grahams@gcc.gnu.org>
Sat, 5 Jun 2004 07:59:39 +0000 (07:59 +0000)
committerGraham Stott <grahams@gcc.gnu.org>
Sat, 5 Jun 2004 07:59:39 +0000 (07:59 +0000)
* combine.c(simplify_shift_const): Check shift amount is a
CONST_INT.

From-SVN: r82644

gcc/ChangeLog
gcc/combine.c

index 4b1360aeec3315aeefef9244ffed7a6db902e70f..1e010f18dc7726e71e685d5941ff4d6fb00de5ce 100644 (file)
@@ -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>
index 64af27c779bd3e3ecc84f4e62ad8e0084b08c475..44ca720bc19fbdc59aeb57cfd39e7d65fdc99253 100644 (file)
@@ -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;