https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128493
Adrian Herrmann <adrian.herrmann.xyz at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |adrian.herrmann.xyz at gmail
dot c
| |om
--- Comment #1 from Adrian Herrmann <adrian.herrmann.xyz at gmail dot com> ---
Still reproduces on trunk (5a61875b0cd983e57dd44b7d6e12b9eb11985bae), including
with explicit alignment and vector_size typedefs:
export module m;
typedef int T __attribute__((aligned(16), may_alias));
typedef unsigned long long V __attribute__((vector_size(64), aligned(64),
may_alias));
In gcc/attribs.cc (decl_attributes), when aligned creates a typedef variant
first (setting DECL_ORIGINAL_TYPE (*node) and TYPE_NAME (*anode) = *node), a
subsequent type attribute like may_alias hits *anode =
build_type_attribute_variant (*anode, r). That calls build_distinct_type_copy
on the typedef variant, creating a main variant whose TYPE_NAME still points to
the TYPE_DECL while DECL_ORIGINAL_TYPE stays stale, which then trips
has_definition / trees_out::decl_value in cp/module.cc.
I have a patch fixing this in decl_attributes and plan to send it to
gcc-patches.