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

            Bug ID: 126935
           Summary: SVE2 incorrectly detected on aarch64 vm
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jklowden at gcc dot gnu.org
  Target Milestone: ---

Created attachment 65367
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65367&action=edit
patch libcpp/configure.ac

Commit ad3f5b0855ef5f3efd6b0a13c29f98cdbf598eb7 on August 5 modified
search_line_fast on aarch64.  Unfortunately on at least one VM the commit
consistently results in a build ending bright and early with 

build/genmatch --gimple \
    --header=tmp-gimple-match-auto.h --include=gimple-match-auto.h \
    /home/jklowden/projects/3rd/gcc/bobdev/gcc/match.pd  tmp-gimple-match-1.cc 
tmp-gimple-match-2.cc  tmp-gimple-match-3.cc  tmp-gimple-match-4.cc 
tmp-gimple-match-5.cc  tmp-gimple-match-6.cc  tmp-gimple-match-7.cc 
tmp-gimple-match-8.cc  tmp-gimple-match-9.cc  tmp-gimple-match-10.cc
make[3]: *** [Makefile:3102: s-gimple-match] Illegal instruction (core dumped)

This despite the apparent promise of the aarch64-unknown-linux-gnu (Multipass)
VM to support SVE2, per cpuinfo: 

Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp
asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit
uscat ilrcpc flagm sb paca pacg dcpodp sve2 flagm2 frint svei8mm svebf16 bf16
afp
CPU implementer : 0x61

rdubner@ has observed the same behavior inconsistently on real hardware.  

The attached patch creates a workaround: a --disable-sve2 option for
libcpp/configure.ac to forego the optimal code in favor of slow but working
code on machines too big for their britches.  If not used, behavior is as
before.  If the disable-sve2 variation is used, the logic to test for SVE2
support is skipped and configuration proceeds and though it failed by setting
libcpp_cv_have_sve2 to "no".  

If it is acceptable, I will generate libcpp/configure and commit.

Reply via email to