public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/vrull/heads/slp-improvements)] Fix: Check for gassign before calling gimple_assign_rhs_code
@ 2024-01-23 20:59 Philipp Tomsich
  0 siblings, 0 replies; 2+ messages in thread
From: Philipp Tomsich @ 2024-01-23 20:59 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:977270bbadbae7828d903c70342436c61a6baca6

commit 977270bbadbae7828d903c70342436c61a6baca6
Author: Manolis Tsamis <manolis.tsamis@vrull.eu>
Date:   Thu Jan 4 13:56:21 2024 +0100

    Fix: Check for gassign before calling gimple_assign_rhs_code
    
    Ref #342

Diff:
---
 gcc/tree-vect-slp.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 04184cab1cf..16bc447b0f0 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -1838,14 +1838,17 @@ try_rearrange_oprnd_info (vec<slp_oprnd_info> &oprnds_info, unsigned group_size)
   if (oprnds_info.length() != 2 || group_size % 4 != 0)
     return SLP_OPRND_PATTERN_NONE;
 
-  enum tree_code code = oprnds_info[0]->def_stmts[0] ?
-    gimple_assign_rhs_code (oprnds_info[0]->def_stmts[0]->stmt)
-    : ERROR_MARK;
+  if (!oprnds_info[0]->def_stmts[0]
+      || !is_a<gassign *> (oprnds_info[0]->def_stmts[0]->stmt))
+    return SLP_OPRND_PATTERN_NONE;
 
+  enum tree_code code
+    = gimple_assign_rhs_code (oprnds_info[0]->def_stmts[0]->stmt);
   FOR_EACH_VEC_ELT (oprnds_info, i, oprnd_info)
     for (unsigned int j = 0; j < group_size; j += 1)
       {
 	if (!oprnd_info->def_stmts[j]
+	    || !is_a<gassign *> (oprnd_info->def_stmts[j]->stmt)
 	    || STMT_VINFO_DATA_REF (oprnd_info->def_stmts[j]))
 	  return SLP_OPRND_PATTERN_NONE;
 	/* Don't mix different operations.  */

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

* [gcc(refs/vendors/vrull/heads/slp-improvements)] Fix: Check for gassign before calling gimple_assign_rhs_code
@ 2024-01-17 19:15 Philipp Tomsich
  0 siblings, 0 replies; 2+ messages in thread
From: Philipp Tomsich @ 2024-01-17 19:15 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:95f071f025a7f27a66e1a78a921a32ae078e3864

commit 95f071f025a7f27a66e1a78a921a32ae078e3864
Author: Manolis Tsamis <manolis.tsamis@vrull.eu>
Date:   Thu Jan 4 13:56:21 2024 +0100

    Fix: Check for gassign before calling gimple_assign_rhs_code
    
    Ref #342

Diff:
---
 gcc/tree-vect-slp.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 704996afe7a..e5842f022f1 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -1838,14 +1838,17 @@ try_rearrange_oprnd_info (vec<slp_oprnd_info> &oprnds_info, unsigned group_size)
   if (oprnds_info.length() != 2 || group_size % 4 != 0)
     return SLP_OPRND_PATTERN_NONE;
 
-  enum tree_code code = oprnds_info[0]->def_stmts[0] ?
-    gimple_assign_rhs_code (oprnds_info[0]->def_stmts[0]->stmt)
-    : ERROR_MARK;
+  if (!oprnds_info[0]->def_stmts[0]
+      || !is_a<gassign *> (oprnds_info[0]->def_stmts[0]->stmt))
+    return SLP_OPRND_PATTERN_NONE;
 
+  enum tree_code code
+    = gimple_assign_rhs_code (oprnds_info[0]->def_stmts[0]->stmt);
   FOR_EACH_VEC_ELT (oprnds_info, i, oprnd_info)
     for (unsigned int j = 0; j < group_size; j += 1)
       {
 	if (!oprnd_info->def_stmts[j]
+	    || !is_a<gassign *> (oprnd_info->def_stmts[j]->stmt)
 	    || STMT_VINFO_DATA_REF (oprnd_info->def_stmts[j]))
 	  return SLP_OPRND_PATTERN_NONE;
 	/* Don't mix different operations.  */

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

end of thread, other threads:[~2024-01-23 20:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-23 20:59 [gcc(refs/vendors/vrull/heads/slp-improvements)] Fix: Check for gassign before calling gimple_assign_rhs_code Philipp Tomsich
  -- strict thread matches above, loose matches on Subject: below --
2024-01-17 19:15 Philipp Tomsich

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).