https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94437
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |NEW --- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed on trunk. 7157 loc = type_hash_table->find_slot_with_hash (&in, hashcode, INSERT); 7158 if (*loc) 7159 { 7160 tree t1 = ((type_hash *) *loc)->type; 7161 gcc_assert (TYPE_MAIN_VARIANT (t1) == t1 7162 && t1 != type); so it looks like the target specific attribute handler wrecks things here. The code does static tree avr_handle_progmem_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, int flags ATTRIBUTE_UNUSED, bool *no_add_attrs) { ... tree newtype = build_type_attribute_variant (type, attr); TYPE_MAIN_VARIANT (newtype) = TYPE_MAIN_VARIANT (type); but built_type_attribute_variant builds a distinct copy and inserts it into the hash, expecting only main variants to be present there. The above assignment breaks that assumption.