public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR91181
@ 2019-07-17  7:06 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2019-07-17  7:06 UTC (permalink / raw)
  To: gcc-patches


Bootstrapped / tested on x86_64-unknown-linux-gnu, applied.

Richard.

2019-07-17  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91181
	* tree-vect-slp.c (vect_build_slp_tree_1): Do not compare
	IFN_LOADs as calls.

	* gcc.dg/pr91181.c: New testcase.

Index: gcc/tree-vect-slp.c
===================================================================
--- gcc/tree-vect-slp.c	(revision 273490)
+++ gcc/tree-vect-slp.c	(working copy)
@@ -857,7 +857,7 @@ vect_build_slp_tree_1 (unsigned char *sw
 	      continue;
 	    }
 
-	  if (rhs_code == CALL_EXPR)
+	  if (!load_p && rhs_code == CALL_EXPR)
 	    {
 	      if (!compatible_calls_p (as_a <gcall *> (stmts[0]->stmt),
 				       as_a <gcall *> (stmt)))
Index: gcc/testsuite/gcc.dg/pr91181.c
===================================================================
--- gcc/testsuite/gcc.dg/pr91181.c	(nonexistent)
+++ gcc/testsuite/gcc.dg/pr91181.c	(working copy)
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast" } */
+/* { dg-additional-options "-mavx" { target x86_64-*-* i?86-*-* } } */
+
+enum { a, b, c };
+float *d, *e;
+int f, g, h, i;
+int j()
+{
+  float a;
+  for (; h; h++)
+    {
+      i = h * 4;
+      a = d[i + b];
+      if (a) {
+	  e[i + b] = g < d[i + b] * f * a ? g : d[i + b] * f * a;
+	  e[i + c] = g < d[i + c] * f * a ? g : d[i + c] * f * a;
+      }
+      e[i + b] = e[i + c];
+    }
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-17  7:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17  7:06 [PATCH] Fix PR91181 Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).