Andreas noticed I forgot to check if the target can fix/float a vector.

Bootstrap / regtest pending on x86_64-unknown-linux-gnu.  Verified
the fix with a cross to ia64-linux.

Richard.

2016-10-04  Richard Biener  <rguent...@suse.de>

        PR tree-optimization/77399
        * tree-ssa-forwprop.c (simplify_vector_constructor): Properly
        verify the target can convert.

        * gcc.dg/tree-ssa/forwprop-35.c: Adjust.

Index: gcc/tree-ssa-forwprop.c
===================================================================
--- gcc/tree-ssa-forwprop.c     (revision 240739)
+++ gcc/tree-ssa-forwprop.c     (working copy)
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3.
 #include "builtins.h"
 #include "tree-cfgcleanup.h"
 #include "cfganal.h"
+#include "optabs-tree.h"
 
 /* This pass propagates the RHS of assignment statements into use
    sites of the LHS of the assignment.  It's basically a specialized
@@ -2037,6 +2038,13 @@ simplify_vector_constructor (gimple_stmt
          != TYPE_VECTOR_SUBPARTS (TREE_TYPE (orig))))
     return false;
 
+  tree tem;
+  if (conv_code != ERROR_MARK
+      && (! supportable_convert_operation (conv_code, type, TREE_TYPE (orig),
+                                          &tem, &conv_code)
+         || conv_code == CALL_EXPR))
+    return false;
+
   if (maybe_ident)
     {
       if (conv_code == ERROR_MARK)
Index: gcc/testsuite/gcc.dg/tree-ssa/forwprop-35.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/forwprop-35.c (revision 240739)
+++ gcc/testsuite/gcc.dg/tree-ssa/forwprop-35.c (working copy)
@@ -14,5 +14,5 @@ v4sf vec_cast_perm(v4si f)
   return (v4sf){f[1], f[1], f[2], f[3]};
 }
 
-/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "cddce1" } } */
-/* { dg-final { scan-tree-dump-times "\\\(v4sf\\\) " 2 "cddce1" } } */
+/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "cddce1" { target 
x86_64-*-* } } } */
+/* { dg-final { scan-tree-dump-times "\\\(v4sf\\\) " 2 "cddce1" { target 
x86_64-*-* } } } */

Reply via email to