[gcc r17-3464] Fixup tree_nop_conversion_p WRT BLKmode vector types

Richard Biener via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:ffb9629b258229099c8f47d391af7897a640b2cd

commit r17-3464-gffb9629b258229099c8f47d391af7897a640b2cd
Author: Richard Biener <[email protected]>
Date:   Thu Aug 13 15:23:01 2026 +0200

    Fixup tree_nop_conversion_p WRT BLKmode vector types
    
    This special-cases BLKmode vector types appropriately.
    
            * tree.cc (tree_nop_conversion_p): Special case two BLKmode
            types.

Diff:
---
 gcc/tree.cc | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gcc/tree.cc b/gcc/tree.cc
index 19069eb59607..52313fbd129f 100644
--- a/gcc/tree.cc
+++ b/gcc/tree.cc
@@ -12462,6 +12462,19 @@ tree_nop_conversion_p (const_tree outer_type, const_tree inner_type)
 	  || TREE_CODE (inner_type) == OFFSET_TYPE))
     return TYPE_PRECISION (outer_type) == TYPE_PRECISION (inner_type);
 
+  if (TYPE_MODE (outer_type) == BLKmode
+      && TYPE_MODE (inner_type) == BLKmode)
+    {
+      if (VECTOR_TYPE_P (outer_type)
+	  && VECTOR_TYPE_P (inner_type)
+	  && known_eq (TYPE_VECTOR_SUBPARTS (outer_type),
+		       TYPE_VECTOR_SUBPARTS (inner_type))
+	  && (TYPE_MODE (TREE_TYPE (outer_type))
+	      == TYPE_MODE (TREE_TYPE (inner_type))))
+	return true;
+      return false;
+    }
+
   /* Otherwise fall back on comparing machine modes (e.g. for
      aggregate types, floats).  */
   return TYPE_MODE (outer_type) == TYPE_MODE (inner_type);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.