From: Xi Ruoyao Date: Thu, 18 Dec 2025 03:39:38 +0000 (+0800) Subject: LoongArch: relax the check for --with-tune X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f478b1d25bab8f45309cf43cf274b4d12785456;p=thirdparty%2Fgcc.git LoongArch: relax the check for --with-tune 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. --- diff --git a/gcc/config.gcc b/gcc/config.gcc index ed862ca12f4..6c8545883fd 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -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