PR tree-optimization/40550
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 28 Jun 2009 18:33:54 +0000 (18:33 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 28 Jun 2009 18:33:54 +0000 (18:33 +0000)
* tree-vect-generic.c (expand_vector_operations_1): Compute in
vector_compute_type only when the size of vector_compute_type is
less than the size of type.

testsuite/ChangeLog:

PR tree-optimization/40550
* gcc.dg/pr40550.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149038 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr40550.c [new file with mode: 0644]
gcc/tree-vect-generic.c

index 1c9a1c2..e6a5cea 100644 (file)
@@ -1,3 +1,10 @@
+2009-06-28  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR tree-optimization/40550
+       * tree-vect-generic.c (expand_vector_operations_1): Compute in
+       vector_compute_type only when the size of vector_compute_type is
+       less than the size of type.
+
 2009-06-28  Eric Botcazou  <ebotcazou@adacore.com>
 
        * fold-const.c (contains_label_1): Fix comments.
        problem_MD, df_md_add_problem): New.
        * df.h (DF_MD, DF_MD_BB_INFO, struct df_md_bb_info, df_md,
        df_md_get_bb_info): New.
-       DF_LAST_PROBLEM_PLUS1): Adjust.
+       (DF_LAST_PROBLEM_PLUS1): Adjust.
 
        * Makefile.in (fwprop.o): Include domwalk.h.
        * fwprop.c: Include domwalk.h.
 
 2009-06-26  Richard Guenther  <rguenther@suse.de>
 
-       * tree-ssa-structalias.c (do_ds_constraint): Simplify escape
-       handling.
+       * tree-ssa-structalias.c (do_ds_constraint): Simplify escape handling.
 
 2009-06-26  Steven Bosscher  <steven@gcc.gnu.org>
 
        * config/avr/avr.md (movmemhi): Use add_reg_note.
        (andhi3, andsi3): Don't use AS2 with "and".
        (iorhi3, iorsi3): Don't use AS2 with "or".
-       * config/avr/avr-protos.h (class_likely_spilled_p): Update
-       declaration.
+       * config/avr/avr-protos.h (class_likely_spilled_p): Update declaration.
        * config/crx/crx.c: Include "df.h".
        (crx_attribute_table): Make static.
        * config/m32r/m32r.c: Include "df.h".
        HARD_REGNO_NREGS, to calculate the number of registers each hard
        register takes for each type.
        (rs6000_debug_reg_print): New function for -mdebug=reg support.
-       (rs6000_debug_vector_unit): New array, map rs6000_vector to
-       string.
+       (rs6000_debug_vector_unit): New array, map rs6000_vector to string.
        (+rs6000_init_hard_regno_mode_ok): New function, move calculation
        of HARD_REGNO_NREGS, CLASS_MAX_NREGS, REGNO_REG_CLASS, and vector
        unit information here so it is calculated once at compiler startup
index 32acab3..80fe78b 100644 (file)
@@ -1,3 +1,8 @@
+2009-06-28  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR tree-optimization/40550
+       * gcc.dg/pr40550.c: New test.
+
 2009-06-28  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/overflow_sum2.adb: New test
diff --git a/gcc/testsuite/gcc.dg/pr40550.c b/gcc/testsuite/gcc.dg/pr40550.c
new file mode 100644 (file)
index 0000000..27935ab
--- /dev/null
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+/* { dg-options "-msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#ifdef __i386__
+#include "cpuid.h"
+#endif
+
+typedef float v2sf __attribute__ ((vector_size (2 * sizeof(float))));
+
+static void test (void)
+{
+  v2sf a = {1.0, 0.0};
+  v2sf b = {0.0, 1.0};
+  v2sf d;
+  d = a + b;
+}
+
+int main ()
+{
+
+#ifdef __i386__
+  unsigned int eax, ebx, ecx, edx;
+
+  if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
+    return 0;
+
+  if (!(edx & bit_SSE))
+    return 0;
+#endif
+
+  test ();
+
+  return 0;
+}
index d99d713..9ef0239 100644 (file)
@@ -482,8 +482,10 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
       tree vector_compute_type
         = type_for_widest_vector_mode (TYPE_MODE (TREE_TYPE (type)), op,
                                       TYPE_SATURATING (TREE_TYPE (type)));
-      if (vector_compute_type != NULL_TREE)
-        compute_type = vector_compute_type;
+      if (vector_compute_type != NULL_TREE
+         && (TYPE_VECTOR_SUBPARTS (vector_compute_type)
+             < TYPE_VECTOR_SUBPARTS (compute_type)))
+       compute_type = vector_compute_type;
     }
 
   /* If we are breaking a BLKmode vector into smaller pieces,