re PR tree-optimization/77399 (Poor code generation for vector casts and loads)
authorRichard Biener <rguenther@suse.de>
Tue, 4 Oct 2016 13:40:54 +0000 (13:40 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 4 Oct 2016 13:40:54 +0000 (13:40 +0000)
2016-10-04  Richard Biener  <rguenther@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.

From-SVN: r240744

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/forwprop-35.c
gcc/tree-ssa-forwprop.c

index 6e0de29444ec16b92edc93a7c97f0019d05bc8a4..e91ec1b349e8c929b1a31e490a4d842cd1264761 100644 (file)
@@ -1,3 +1,9 @@
+2016-10-04  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/77399
+       * tree-ssa-forwprop.c (simplify_vector_constructor): Properly
+       verify the target can convert.
+
 2016-10-04  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/77833
index 9a8692eacf3a67dcf22959d1c5b45d20f33e6e58..c6b9d87c5abaffdd5daab537b5c0f9b6a7859bcd 100644 (file)
@@ -1,3 +1,8 @@
+2016-10-04  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/77399
+       * gcc.dg/tree-ssa/forwprop-35.c: Adjust.
+
 2016-10-04  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/77833
index 24a1ad9c76765cd625c9ad8ce5166dd8a283a05d..79053a285d125906a96086b0525688f08399f158 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O -fdump-tree-cddce1" } */
+/* { dg-additional-options "-msse2" { target { i?86-*-* x86_64-*-* } } } */
 
 typedef int v4si __attribute__((vector_size(16)));
 typedef float v4sf __attribute__((vector_size(16)));
@@ -14,5 +15,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 { i?86-*-* x86_64-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "\\\(v4sf\\\) " 2 "cddce1" { target { i?86-*-* x86_64-*-* } } } } */
index cd066ef0587c3ec9c210c1453b92f97d81eeae74..ed11b32fbfe8fa36831ca016ae1e2ba58e65f9c8 100644 (file)
@@ -45,6 +45,7 @@ along with GCC; see the file COPYING3.  If not see
 #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_iterator *gsi)
          != 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)