gnu/gcc/ec2890c334eaccbe37e2e2eae6a4de62fefdcbf8 libcpp: require SVE as well as SVE2 for the AArch64 lexer [PR126935]
init_vectorized_lexer only tested HWCAP2_SVE2. Some virtual machines
advertise SVE2 while leaving SVE clear, which is a nonsense
configuration but one that occurs in practice, and there the compiler
dies as soon as it lexes anything:
build/genmatch --gimple ...
make[3]: *** [Makefile:3102: s-gimple-match] Illegal instruction
Test HWCAP_SVE alongside HWCAP2_SVE2 so the run-time dispatch declines
the SVE2 helper on such a machine and keeps using Neon.
SVE2 without SVE is a nonsense configuration architecture-wise and
arguably the VM hypervisor is at fault here, but it is easy to work around
for the sake of fixing bootstrap on such machines.
libcpp/ChangeLog:
PR target/126935
* lex.cc (HWCAP_SVE): Define if not already defined.
(init_vectorized_lexer): Require HWCAP_SVE as well as
HWCAP2_SVE2.
Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>
1 file changed