]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
middle-end/112732 - stray TYPE_ALIAS_SET in type variant
authorRichard Biener <rguenther@suse.de>
Tue, 28 Nov 2023 11:36:21 +0000 (12:36 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 8 May 2024 11:43:54 +0000 (13:43 +0200)
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)

gcc/tree.cc

index 1d1c240b257378a1cde28a641bb9de97192cab9a..12dea81a5f39906f74e3cd563bf367c4e9f050a3 100644 (file)
@@ -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;
 }