]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: relax the check for --with-tune
authorXi Ruoyao <xry111@xry111.site>
Thu, 18 Dec 2025 03:39:38 +0000 (11:39 +0800)
committerXi Ruoyao <xry111@xry111.site>
Tue, 23 Dec 2025 07:33:05 +0000 (15:33 +0800)
Someone (via a WeChat group) reported that --with-arch=la464
--with-tune=la664 had stopped to work after commiting the LA32 support.

While this can be treated as a simple logic error (i.e. we may simply
change "loongarch64" in the case statement to an asterisk), IMO we
should just relax the check: at runtime the "unreasonable" combinations
like "-march=la64v1.0 -mtune=loongarch32" or "-march=la664 -mtune=la464"
is allowed (and the second case has been allowed for a long time), and a
combination of --with-arch=A --with-tune=T should be allowed if -march=A
-mtune=T is allowed at runtime.

Also if we consider the fact that --with-tune= and -mtune= only select a
set of heruistic parameters, such combinations may be not so
unreasonable.

gcc/

* config.gcc: Relax the check for LoongArch with_tune.

gcc/config.gcc

index ed862ca12f475dbff5de55ce1882cec02459ac22..6c8545883fd2bbaed6236d62c78145b0fd697408 100644 (file)
@@ -5334,14 +5334,7 @@ case "${target}" in
 
 
                # Check default with_tune configuration using with_arch.
-               case ${with_arch} in
-               la32v1.0 | la32rv1.0)
-                       tune_pattern="loongarch32"
-                       ;;
-               loongarch64)
-                       tune_pattern="native|generic|loongarch64|la[46]64"
-                       ;;
-               esac
+               tune_pattern="native|generic|loongarch64|la[46]64|loongarch32"
 
                case ${with_tune} in
                "") ;; # OK