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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|67491                       |
           Keywords|needs-reduction             |ice-on-valid-code

--- Comment #8 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Here's a reduced sample that exhibits the same ICE, without needing concepts:

$ cat a.hpp
template <int _Bytes>
using __vec_builtin_type_bytes [[__gnu__::__vector_size__(_Bytes)]] = int;

template <typename _TV>
__vec_builtin_type_bytes<32> __vec_bit_cast(_TV __x) { return __x; }

inline void __x86_movmsk() {
  __vec_builtin_type_bytes<32> __x;
  __vec_bit_cast(__x);
}

$ cat b.cpp
import "a.hpp";

$ g++ -fmodule-header a.hpp
a.hpp: In instantiation of ‘__vec_builtin_type_bytes<32> __vec_bit_cast(_TV)
[with _TV = __vector(8) int; __vec_builtin_type_bytes<32> = __vector(8) int]’:
a.hpp:9:17:   required from here
    9 |   __vec_bit_cast(__x);
      |   ~~~~~~~~~~~~~~^~~~~
a.hpp:5:30: warning: AVX vector return without AVX enabled changes the ABI
[-Wpsabi]
    5 | __vec_builtin_type_bytes<32> __vec_bit_cast(_TV __x) { return __x; }
      |                              ^~~~~~~~~~~~~~

$ g++ -fmodules -fno-module-lazy -S b.cpp

internal compiler error: error reporting routines re-entered.
0x233e49d error_at(unsigned long, char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:655
0x946942 recursive_lazy
        ../../gcc/gcc/cp/module.cc:16622
0x946942 recursive_lazy
        ../../gcc/gcc/cp/module.cc:16618
0x946942 lazy_load_pendings(tree_node*, tree_node*)
        ../../gcc/gcc/cp/module.cc:22607
0xa158f7 instantiate_template(tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/pt.cc:23432
0xa15eab instantiate_alias_template
        ../../gcc/gcc/cp/pt.cc:23651
0xa15eab instantiate_alias_template
        ../../gcc/gcc/cp/pt.cc:23627
0x9fada5 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.cc:16938
0x8d6336 dump_template_bindings
        ../../gcc/gcc/cp/error.cc:625
0x8d0077 dump_function_decl
        ../../gcc/gcc/cp/error.cc:2074
0x8d758b decl_to_string
        ../../gcc/gcc/cp/error.cc:3569
0x8d758b cp_printer
        ../../gcc/gcc/cp/error.cc:4895
0x238ab86 format_phase_2
        ../../gcc/gcc/pretty-print.cc:2303
0x238ab86 pretty_printer::format(text_info&)
        ../../gcc/gcc/pretty-print.cc:1846
0x238cf53 pp_format(pretty_printer*, text_info*)
        ../../gcc/gcc/pretty-print.h:599
0x238cf53 pp_printf(pretty_printer*, char const*, ...)
        ../../gcc/gcc/pretty-print.cc:2689
0x8d8c79 cp_print_error_function
        ../../gcc/gcc/cp/error.cc:3879
0x8d8c79 cp_diagnostic_text_starter
        ../../gcc/gcc/cp/error.cc:3831
0x236dc8d
diagnostics::text_sink::on_report_diagnostic(diagnostics::diagnostic_info
const&, diagnostics::kind)
        ../../gcc/gcc/diagnostics/text-sink.cc:215
0x2345704
diagnostics::context::report_diagnostic(diagnostics::diagnostic_info*)
        ../../gcc/gcc/diagnostics/context.cc:1535
/home/wreien/.local/libexec/gcc/x86_64-pc-linux-gnu/16.0.1/cc1plus -quiet
-imultiarch x86_64-linux-gnu -D_GNU_SOURCE b.cpp -quiet -dumpbase b.cpp
-dumpbase-ext .cpp -mtune=generic -march=x86-64 -fmodules -fno-module-lazy -o
b.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


(In reply to Matthias Kretz (Vir) from comment #7)
> Since I already tried my best to get rid of the ABI warning, I assume there
> is little I can do to work around the issue, right?

Yes, it doesn't look like there's anything you could do from library side
except maybe avoiding the use of template aliases, which I imagine is utterly
infeasible :D


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
[Bug 67491] [meta-bug] concepts issues

Reply via email to