middle-end/112732 - stray TYPE_ALIAS_SET in type variant

Message ID 20231128155700.06E3C133B5@imap2.dmz-prg2.suse.org
State Committed
Commit f26d68d5d128c86faaceeb81b1e8f22254ad53df
Headers
Series middle-end/112732 - stray TYPE_ALIAS_SET in type variant |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-arm warning Patch is already merged
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 warning Patch is already merged

Commit Message

Richard Biener Nov. 28, 2023, 3:56 p.m. UTC
  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.

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

	PR middle-end/112732
	* tree.cc (build_opaque_vector_type): Reset TYPE_ALIAS_SET
	of the newly built type.
---
 gcc/tree.cc | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/gcc/tree.cc b/gcc/tree.cc
index e9f703e7237..10c6e1ecc58 100644
--- a/gcc/tree.cc
+++ b/gcc/tree.cc
@@ -10274,6 +10274,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;
 }