https://gcc.gnu.org/g:664ab9c6e8a5d031031596100997e025e5334e86

commit r13-8721-g664ab9c6e8a5d031031596100997e025e5334e86
Author: Richard Biener <rguent...@suse.de>
Date:   Tue Nov 28 12:36:21 2023 +0100

    middle-end/112732 - stray TYPE_ALIAS_SET in type variant
    
    The following fixes a stray TYPE_ALIAS_SET in a type variant built
    by build_opaque_vector_type which is diagnosed by type checking
    enabled with -flto.
    
            PR middle-end/112732
            * tree.cc (build_opaque_vector_type): Reset TYPE_ALIAS_SET
            of the newly built type.
    
    (cherry picked from commit f26d68d5d128c86faaceeb81b1e8f22254ad53df)

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

diff --git a/gcc/tree.cc b/gcc/tree.cc
index 1d1c240b2573..12dea81a5f39 100644
--- a/gcc/tree.cc
+++ b/gcc/tree.cc
@@ -10182,6 +10182,8 @@ build_opaque_vector_type (tree innertype, poly_int64 
nunits)
   TYPE_NEXT_VARIANT (cand) = TYPE_NEXT_VARIANT (t);
   TYPE_NEXT_VARIANT (t) = cand;
   TYPE_MAIN_VARIANT (cand) = TYPE_MAIN_VARIANT (t);
+  /* Type variants have no alias set defined.  */
+  TYPE_ALIAS_SET (cand) = -1;
   return cand;
 }

Reply via email to