re PR rtl-optimization/36438 (gcc ICE compiling code with mmx builtin)
authorUros Bizjak <uros@gcc.gnu.org>
Fri, 6 Jun 2008 15:04:51 +0000 (17:04 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 6 Jun 2008 15:04:51 +0000 (17:04 +0200)
PR rtl-optimization/36438
* cse.c (fold_rtx) [ASHIFT, LSHIFTRT, ASHIFTRT]: Break out early
for vector shifts with constant scalar shift operands.

From-SVN: r136486

gcc/ChangeLog
gcc/cse.c
gcc/testsuite/gcc.target/i386/pr36438.c [new file with mode: 0644]

index 2447ed4c0e63f613a0affa9a683769fca2a2bb44..076cfe347c29e2c9f0a24b18c2c2eb366b7669a6 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-06 Uros Bizjak <ubizjak@gmail.com>
+
+       PR rtl-optimization/36438
+       * cse.c (fold_rtx) [ASHIFT, LSHIFTRT, ASHIFTRT]: Break out early
+       for vector shifts with constant scalar shift operands.
+
 2008-06-06  Sandip Matte  <sandip@rmicorp.com>
 
        * doc/invoke.texi: Document -march=xlr.
@@ -25,8 +31,7 @@
 
 2008-06-06  Jakub Jelinek  <jakub@redhat.com>
 
-       * c-cppbuiltin.c (c_cpp_builtins): Change _OPENMP value to
-       200805.
+       * c-cppbuiltin.c (c_cpp_builtins): Change _OPENMP value to 200805.
        * langhooks.h (struct lang_hooks_for_decls): Add omp_finish_clause.
        Add omp_private_outer_ref hook, add another argument to
        omp_clause_default_ctor hook.
        (gimplify_omp_parallel, gimplify_omp_for, gimplify_omp_workshare):
        Adjust callers.
        (gimplify_adjust_omp_clauses_1): Set OMP_CLAUSE_PRIVATE_OUTER_REF if
-       GOVD_PRIVATE_OUTER_REF is set.  Call omp_finish_clause
-       langhook.
+       GOVD_PRIVATE_OUTER_REF is set.  Call omp_finish_clause langhook.
        (new_omp_context): Set default_kind to
        OMP_CLAUSE_DEFAULT_UNSPECIFIED for OMP_TASK regions.
        (omp_region_type): New enum.
        omp_for_data changes.
        (lower_omp_for): Add rec input clauses before OMP_FOR_PRE_BODY,
        not after it.  Handle collapsed OMP_FOR loops, adjust for
-       OMP_FOR_{INIT,COND,INCR} changes, adjust extract_omp_for_data
-       caller.
+       OMP_FOR_{INIT,COND,INCR} changes, adjust extract_omp_for_data caller.
        (get_ws_args_for): Adjust extract_omp_for_data caller.
        (scan_omp_for): Handle collapsed OMP_FOR
        loops, adjust for OMP_FOR_{INIT,COND,INCR} changes.
 2008-06-04  Andy Hutchinson  <hutchinsonandy@aim.com>
 
        PR target/27386
-       * config/avr/avr.h: (PUSH_ROUNDING): Remove.
+       * config/avr/avr.h (PUSH_ROUNDING): Remove.
 
 2008-06-04  Andy Hutchinson  <hutchinsonandy@aim.com>
 
 
 2008-06-04  Richard Guenther  <rguenther@suse.de>
 
-       * tree-flow-inline.h (is_global_var): Do not check TREE_STATIC
-       on MTAGs.
+       * tree-flow-inline.h (is_global_var): Do not check TREE_STATIC on MTAGs.
        (is_call_clobbered): Always check var_ann->call_clobbered.
        (mark_call_clobbered): Always set var_ann->call_clobbered.
        (clear_call_clobbered): Always clear var_ann->call_clobbered.
        (may_be_aliased): Do not check TREE_PUBLIC on MTAGs.
 
 2008-06-04  Joseph Myers  <joseph@codesourcery.com>
-            Maxim Kuvyrkov  <maxim@codesourcery.com>
+           Maxim Kuvyrkov  <maxim@codesourcery.com>
 
        * config/m68k/m68k.opt (mxgot): New option.
        * config/m68k/m68k.c (legitimize_pic_address): Handle -mxgot.
 
 2008-06-03  H.J. Lu  <hongjiu.lu@intel.com>
 
-       *  config/i386/i386.c (ix86_gen_leave): New.
+       * config/i386/i386.c (ix86_gen_leave): New.
        (ix86_gen_pop1): Likewise.
        (ix86_gen_add3): Likewise.
        (ix86_gen_sub3): Likewise.
 2008-06-03  Kai Tietz  <kai.tietz@onevision.com>
 
        * config/i386/i386-protos.h (ix86_reg_parm_stack_space): New.
-       * config/i386/i386.h (ix86_reg_parm_stack_space): Removed
-       prototype.
+       * config/i386/i386.h (ix86_reg_parm_stack_space): Removed prototype.
        * config/i386/i386.c (ix86_reg_parm_stack_space): Changed
        return type to int.
        (ix86_call_abi_override): Remove check for call_used_regs.
 
        * doc/tm.texi (OVERRIDE_ABI_FORMAT): New.
        * doc/extend.texi (ms_abi,sysv_abi): New attribute description.
-       * function.c (allocate_struct_function): Use of
-       OVERRIDE_ABI_FORMAT.
+       * function.c (allocate_struct_function): Use of OVERRIDE_ABI_FORMAT.
        * config/i386/cygming.h (TARGET_64BIT_MS_ABI): Make use
        of cfun and DEFAULT_ABI to deceide abi mode.
        (DEFAULT_ABI): New.
        (ix86_reg_parm_stack_space): New prototype.
        (CUMULATIVE_ARGS): Add call_abi member.
        (machine_function): Add call_abi member.
-       * config/i386/mingw32.h (EXTRA_OS_CPP_BUILTINS): Replace TARGET_64BIT_MS_ABI
-       by DEFAULT_ABI compare to MS_ABI.
+       * config/i386/mingw32.h (EXTRA_OS_CPP_BUILTINS): Replace
+       TARGET_64BIT_MS_ABI by DEFAULT_ABI compare to MS_ABI.
 
 2008-06-02  Andy Hutchinson  <hutchinsonandy@aim.com> 
 
index ffe7efb600663f7a3473319f0b5c768afa6fb64d..73eb1c6805b554b2be31dbf876d49555b6996f70 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3489,6 +3489,11 @@ fold_rtx (rtx x, rtx insn)
                          && exact_log2 (- INTVAL (const_arg1)) >= 0)))
                break;
 
+             /* ??? Vector mode shifts by scalar
+                shift operand are not supported yet.  */
+             if (is_shift && VECTOR_MODE_P (mode))
+                break;
+
              if (is_shift
                  && (INTVAL (inner_const) >= GET_MODE_BITSIZE (mode)
                      || INTVAL (inner_const) < 0))
diff --git a/gcc/testsuite/gcc.target/i386/pr36438.c b/gcc/testsuite/gcc.target/i386/pr36438.c
new file mode 100644 (file)
index 0000000..38376b8
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mmmx" } */
+
+#include <mmintrin.h>
+
+extern __m64 SetS16 (unsigned short, unsigned short,
+                    unsigned short, unsigned short);
+
+void foo(__m64* dest)
+{
+  __m64 mask = SetS16 (0x00FF, 0xFF00, 0x0000, 0x00FF);
+
+  mask = _mm_slli_si64(mask, 8);
+  mask = _mm_slli_si64(mask, 8);
+
+  *dest = mask;
+
+  _mm_empty ();
+}