2010-03-30 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/43430
* tree-vect-slp.c (vect_get_and_check_slp_defs): Replace type
pointer comparisons with types_compatible_p.
* tree-vect-stmts.c (vectorizable_call): Same.
(vectorizable_condition): Same.
* gcc.dg/vect/pr43430-1.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157833
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-03-30 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/43430
+ * tree-vect-slp.c (vect_get_and_check_slp_defs): Replace type
+ pointer comparisons with types_compatible_p.
+ * tree-vect-stmts.c (vectorizable_call): Same.
+ (vectorizable_condition): Same.
+
2010-03-30 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c (s390_emit_prologue): Omit issuing a dynamic
+2010-03-30 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/43430
+ * gcc.dg/vect/pr43430-1.c: New.
+
2010-03-30 Jason Merrill <jason@redhat.com>
PR c++/43559
--- /dev/null
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+typedef int uint8_t;
+uint8_t data_ch1[N + 1] =
+ { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
+uint8_t data_ch2[N + 1] =
+ { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
+#define SUM 480
+
+__attribute__ ((noinline)) int
+foo (uint8_t * s1, uint8_t * s2, int stride)
+{
+ int score = 0;
+ int x;
+ for (x = 0; x < N; x++)
+ score += ((s1[x] - s1[x + stride] + s2[x + stride]) >= 0 ?
+ s1[x] + s2[x + stride] :
+ s2[x + stride]);
+
+ if (score != SUM)
+ abort ();
+
+ return 0;
+}
+
+int
+main (void)
+{
+ check_vect ();
+ return foo (data_ch1, data_ch2, 1);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
if ((i == 0
&& (*first_stmt_dt0 != dt[i]
|| (*first_stmt_def0_type && def
- && *first_stmt_def0_type != TREE_TYPE (def))))
+ && !types_compatible_p (*first_stmt_def0_type,
+ TREE_TYPE (def)))))
|| (i == 1
&& (*first_stmt_dt1 != dt[i]
|| (*first_stmt_def1_type && def
- && *first_stmt_def1_type != TREE_TYPE (def))))
+ && !types_compatible_p (*first_stmt_def1_type,
+ TREE_TYPE (def)))))
|| (!def
- && TREE_TYPE (*first_stmt_const_oprnd)
- != TREE_TYPE (oprnd)))
+ && !types_compatible_p (TREE_TYPE (*first_stmt_const_oprnd),
+ TREE_TYPE (oprnd))))
{
if (vect_print_dump_info (REPORT_SLP))
fprintf (vect_dump, "Build SLP failed: different types ");
/* We can only handle calls with arguments of the same type. */
if (rhs_type
- && rhs_type != TREE_TYPE (op))
+ && !types_compatible_p (rhs_type, TREE_TYPE (op)))
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "argument types differ.");
/* We do not handle two different vector types for the condition
and the values. */
- if (TREE_TYPE (TREE_OPERAND (cond_expr, 0)) != TREE_TYPE (vectype))
+ if (!types_compatible_p (TREE_TYPE (TREE_OPERAND (cond_expr, 0)),
+ TREE_TYPE (vectype)))
return false;
if (TREE_CODE (then_clause) == SSA_NAME)