public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix ICE in vectorizable_live_operation
@ 2020-10-15  9:49 Richard Biener
  2020-10-15 13:19 ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2020-10-15  9:49 UTC (permalink / raw)
  To: gcc-patches

This fixes the case where the insertion iterator for the live stmt
is the end of a BB by adjusting the dominance query to the definition
of the def we're substituting.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

2020-10-15  Richard Biener  <rguenther@suse.de>

	* tree-vect-loop.c (vectorizable_live_operation): Adjust
	dominance query.

	* gcc.dg/vect/bb-slp-52.c: New testcase.
---
 gcc/testsuite/gcc.dg/vect/bb-slp-52.c | 15 +++++++++++++++
 gcc/tree-vect-loop.c                  |  7 +++++--
 2 files changed, 20 insertions(+), 2 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/vect/bb-slp-52.c

diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-52.c b/gcc/testsuite/gcc.dg/vect/bb-slp-52.c
new file mode 100644
index 00000000000..5194af8cc40
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-52.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+int a, e;
+void g(float);
+typedef struct {
+  float b, c;
+} d;
+d f;
+void h(double i, double j) {
+  if (a && e)
+    return;
+  f.b = j;
+  f.c = i;
+  g(i);
+}
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 0a315e22226..991fd457229 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -8395,8 +8395,11 @@ vectorizable_live_operation (vec_info *vinfo,
 	       were not code-generated yet so it is not too bad.
 	       ???  In fact we'd likely want to avoid this situation
 	       in the first place.  */
-	    if (gimple_code (use_stmt) != GIMPLE_PHI
-		&& !vect_stmt_dominates_stmt_p (gsi_stmt (*gsi), use_stmt))
+	    if (TREE_CODE (new_tree) == SSA_NAME
+		&& !SSA_NAME_IS_DEFAULT_DEF (new_tree)
+		&& gimple_code (use_stmt) != GIMPLE_PHI
+		&& !vect_stmt_dominates_stmt_p (SSA_NAME_DEF_STMT (new_tree),
+						use_stmt))
 	      {
 		enum tree_code code = gimple_assign_rhs_code (use_stmt);
 		gcc_assert (code == CONSTRUCTOR
-- 
2.26.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix ICE in vectorizable_live_operation
  2020-10-15  9:49 [PATCH] Fix ICE in vectorizable_live_operation Richard Biener
@ 2020-10-15 13:19 ` Jeff Law
  2020-10-15 13:32   ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2020-10-15 13:19 UTC (permalink / raw)
  To: Richard Biener, gcc-patches


On 10/15/20 3:49 AM, Richard Biener wrote:
> This fixes the case where the insertion iterator for the live stmt
> is the end of a BB by adjusting the dominance query to the definition
> of the def we're substituting.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
>
> 2020-10-15  Richard Biener  <rguenther@suse.de>
>
> 	* tree-vect-loop.c (vectorizable_live_operation): Adjust
> 	dominance query.
>
> 	* gcc.dg/vect/bb-slp-52.c: New testcase.

Assuming this is a fix for the issue I sent privately last night. 
Thanks a ton!


Jeff



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix ICE in vectorizable_live_operation
  2020-10-15 13:19 ` Jeff Law
@ 2020-10-15 13:32   ` Richard Biener
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Biener @ 2020-10-15 13:32 UTC (permalink / raw)
  To: Jeff Law; +Cc: gcc-patches

On Thu, 15 Oct 2020, Jeff Law wrote:

> 
> On 10/15/20 3:49 AM, Richard Biener wrote:
> > This fixes the case where the insertion iterator for the live stmt
> > is the end of a BB by adjusting the dominance query to the definition
> > of the def we're substituting.
> >
> > Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
> >
> > 2020-10-15  Richard Biener  <rguenther@suse.de>
> >
> > 	* tree-vect-loop.c (vectorizable_live_operation): Adjust
> > 	dominance query.
> >
> > 	* gcc.dg/vect/bb-slp-52.c: New testcase.
> 
> Assuming this is a fix for the issue I sent privately last night.?

Yes.

> Thanks a ton!
> 
> 
> Jeff
> 
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Felix Imend

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-15 13:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15  9:49 [PATCH] Fix ICE in vectorizable_live_operation Richard Biener
2020-10-15 13:19 ` Jeff Law
2020-10-15 13:32   ` 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).