]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Fix internal error running "gcc -march=native" on LA664
authorXi Ruoyao <xry111@xry111.site>
Fri, 17 Nov 2023 12:44:17 +0000 (20:44 +0800)
committerXi Ruoyao <xry111@xry111.site>
Sat, 18 Nov 2023 17:11:09 +0000 (01:11 +0800)
commit56752a6bbfb3d3501d0899b23020c3e2eb58882c
tree1fb8f488fca33ce25477d45c0246edd687a4a23b
parent20a3c74c347429c109bc7002285b735be83f6a0b
LoongArch: Fix internal error running "gcc -march=native" on LA664

On LA664, the PRID preset is ISA_BASE_LA64V110 but the base architecture
is guessed ISA_BASE_LA64V100.  This causes a warning to be outputed:

    cc1: warning: base architecture 'la64' differs from PRID preset '?'

But we've not set the "?" above in loongarch_isa_base_strings, thus it's
a nullptr and then an ICE is triggered.

Add ISA_BASE_LA64V110 to genopts and initialize
loongarch_isa_base_strings[ISA_BASE_LA64V110] correctly to fix the ICE.
The warning itself will be fixed later.

gcc/ChangeLog:

* config/loongarch/genopts/loongarch-strings:
(STR_ISA_BASE_LA64V110): Add.
* config/loongarch/genopts/loongarch.opt.in:
(ISA_BASE_LA64V110): Add.
* config/loongarch/loongarch-def.c
(loongarch_isa_base_strings): Initialize [ISA_BASE_LA64V110]
to STR_ISA_BASE_LA64V110.
* config/loongarch/loongarch.opt: Regenerate.
* config/loongarch/loongarch-str.h: Regenerate.
gcc/config/loongarch/genopts/loongarch-strings
gcc/config/loongarch/genopts/loongarch.opt.in
gcc/config/loongarch/loongarch-def.c
gcc/config/loongarch/loongarch-str.h
gcc/config/loongarch/loongarch.opt