From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sender4-op-o16.zoho.com (sender4-op-o16.zoho.com [136.143.188.16]) by sourceware.org (Postfix) with ESMTPS id 3B01D3870549; Fri, 9 Dec 2022 02:44:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3B01D3870549 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=icenowy.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=icenowy.me ARC-Seal: i=1; a=rsa-sha256; t=1670553845; cv=none; d=zohomail.com; s=zohoarc; b=BUXNBdLg+3L9fCRdqEoKgbN4cn4pIBiDxC0/YVmrLsKDd6u+KpV3uTRRxH0yti8gfNbohnMkGjyBPd09p/vH7RLO4zudZNSWLCbFXB36brdmMt07J1P9PsT4dwNeLNhA+z5lenTJFMSDu3VVbXB2TobwOe9bU2T5MRnbuvK39vE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670553845; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=9wyLrlcSZYuaDXWO0i54AonP0H/qWWpnK8pGp0GaRjg=; b=HFFrLtlIIx6tNZb76zayRfHlf78re/N5EaeYb4IUtFJWqk+J1OaOqkUGGPTDpDnKb9GavTg9FU8/m2bnNTVVbBaE1iBpIvBLt/bv8Rz8wCWcaBOaIAEJkIXLKw3UoDkoSc4XqOf9rXKaFR1rwIyQNHg6mWYc/rXQKRH581LJ+LE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=icenowy.me; spf=pass smtp.mailfrom=uwu@icenowy.me; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1670553845; s=zmail; d=icenowy.me; i=uwu@icenowy.me; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=9wyLrlcSZYuaDXWO0i54AonP0H/qWWpnK8pGp0GaRjg=; b=cZeAmWsnzSBn5vLNHbKCLpOqVKeajLjUQXunX9h0btC8kAOi8ce6Afx4ATKSRmUP oCoKfYHlzcQE5WBbc65Ac1oONZxiD4j4GLo0Hk6Fn8yKomF54i5Me2K8FFVSG9LA+ub NrtCKQgzQ2a4l4mmFqHEeyjvZ1IkzZXtAuDJGf0I= Received: from edelgard.fodlan.icenowy.me (120.85.99.143 [120.85.99.143]) by mx.zohomail.com with SMTPS id 1670553845388481.79994099910596; Thu, 8 Dec 2022 18:44:05 -0800 (PST) From: Icenowy Zheng To: gcc-patches@gcc.gnu.org Cc: Xi Ruoyao , jit@gcc.gnu.org, Icenowy Zheng Subject: [PATCH 1/2] LoongArch: respect the with values in config.gcc Date: Fri, 9 Dec 2022 10:43:48 +0800 Message-Id: <20221209024349.845948-2-uwu@icenowy.me> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221209024349.845948-1-uwu@icenowy.me> References: <20221209024349.845948-1-uwu@icenowy.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-ZohoMailClient: External X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_INFOUSMEBIZ,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: In config.gcc, there's a long code snippet that handles --with-{arch,tune,abi,fpu} and give them default values; however these "with" values are not used at all. Use these "with" values to initialize these variables in specs. gcc/ChangeLog: * config/loongarch/loongarch.h (OPTION_DEFAULT_SPECS): New macro that simply injects configure --with values. Signed-off-by: Icenowy Zheng --- gcc/config/loongarch/loongarch.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h index a402d3ba35a..5e2f4158f70 100644 --- a/gcc/config/loongarch/loongarch.h +++ b/gcc/config/loongarch/loongarch.h @@ -50,6 +50,17 @@ along with GCC; see the file COPYING3. If not see /* Driver native functions for SPEC processing in the GCC driver. */ #include "loongarch-driver.h" +/* Support for a compile-time default CPU, et cetera. The rules are: + --with-arch is ignored if -march is specified. + --with-tune is ignored if -mtune is specified. + --with-abi is ignored if -mabi is specified. + --with-fpu is ignored if -mfpu is specified. */ +#define OPTION_DEFAULT_SPECS \ + {"arch", "%{!march=*:-march=%(VALUE)}" }, \ + {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \ + {"abi", "%{!mabi=*:-mabi=%(VALUE)}" }, \ + {"fpu", "%{!mfpu=*:-mfpu=%(VALUE)}" }, \ + /* This definition replaces the formerly used 'm' constraint with a different constraint letter in order to avoid changing semantics of the 'm' constraint when accepting new address formats in -- 2.38.1