https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124542

Nathaniel Shead <nshead at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |nshead at gcc dot gnu.org
   Last reconfirmed|                            |2026-03-19
             Status|UNCONFIRMED                 |NEW

--- Comment #6 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Confirmed.  The issue in this specific case is that when building the decl for
__vec_bit_cast, allocate_struct_function calls aggregate_value_p which
eventually tries to warn about "AVX vector return without AVX enabled changes
the ABI".

The diagnostic machinery then tries to print a context of "In function
__vec_bit_cast<...>", which ends up calling dump_template_bindings which calls
tsubst on each template parameter.  This causes us to attempt to instantiate an
alias specialisation, which requires constraint satisfaction, which eventually
ends up walking into a tree that hasn't been loaded yet, causing the recursive
load.

Intuitively, we should not be performing instantiations when emitting a
diagnostic, I would think, as this could similarly cause recursive diagnostics;
it just seems that modules has made this easier to trigger.  But it's not clear
to me how to do this just yet.

I'll try to reduce the testcase at least.

Reply via email to