From patchwork Fri Sep 23 15:49:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Hainque X-Patchwork-Id: 1424 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp288289wrt; Fri, 23 Sep 2022 08:50:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7woFA3o2O2aCOX+jhkYIzGCyme4O2E1OvZLo/Wmbm1KClzWlsexJwS8Bz7BC2Qq53O0BPE X-Received: by 2002:a05:6402:1f15:b0:453:a795:4c60 with SMTP id b21-20020a0564021f1500b00453a7954c60mr8941451edb.75.1663948210713; Fri, 23 Sep 2022 08:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663948210; cv=none; d=google.com; s=arc-20160816; b=zZG1YQkTWteuLNZ3Mb50UmXk2OpD0jS8EHTiduPylJO0w3QmDvnId2fyUq30eLJY5b C1QjQDtJcMjkACuVkW9bT+EYjYZq2/Ej0b6WscE87pex6HnBvI+FB+0Lki3TcAd3Awz+ 5ai72JYsYdhzuZmqEsrahiiVrV47DK+ic30l4BDEgl31Cv7izzCUyGmAdqXFnSucTa9v JV3ysmYccHo48bpwiMF8RUuOVhW48DBYDdq8kiUZDgvCP7P7FK7Z/Pyov0YPUWOEpZGr YKEaDdDvIlIjUDG7cf4zqxsHPqCVlc0LFIfJjOc7wIz7frU4ZPqFttE1/m/N5sT5qYzC NAHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :user-agent:content-disposition:mime-version:message-id:subject:to :date:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=NNkuXC6/mE1OOtGydWeDlqisvqct8///gTm5QCKh0mk=; b=Omp/+PWLts01qh4D6pFKsP4ccvV3clFN0mmUzySZIxDYUvzKLWkxKCrRfk67DJneSP 2Z6salzZBxExlo3OzAyVGFgbyct8woZAQJ0SSdIrnomgn2c4CVyEB5sht3jUjOkPfQLn 5m9yUUm2p7zd6o1V8P04G3vvFgrNijpBpjRot6fCBFyeAszc8NYQzzJYZ9ExnksuocL2 AZUJ6ojB0mgCjehkBjQCS5D0o7WrMC3jJ5z5dARl1EFXpQep+YK0vfio7fIP/fTbipOv ujAAE2qTt+98rEApr3nc8a4tTozOVqaz27cJNI0HUt6R6G+1PseIdZHEJlu3GWTPVbcc Lfmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="fW/JjFkm"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id g22-20020a17090613d600b0078142aeb4eesi6828922ejc.475.2022.09.23.08.50.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 08:50:10 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="fW/JjFkm"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A681A3857034 for ; Fri, 23 Sep 2022 15:50:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A681A3857034 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663948209; bh=NNkuXC6/mE1OOtGydWeDlqisvqct8///gTm5QCKh0mk=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=fW/JjFkmJTTDSXp7AO9BXMnCtLAXwvagMDKUNs8WCrMoYYUbkY8ITEHJ98jta5ORu 4qCKdIgn3aJ8JYRMoAc6XP/SN0z/WyQiq32YOBmtToocr2jCdzdygA0u8QjL17MTIp 6QlI2nXJInqfi1GgpFQJXhZguSe7k5jiNJqlJpt4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from rock.gnat.com (rock.gnat.com [205.232.38.15]) by sourceware.org (Postfix) with ESMTPS id 33B483857B8D for ; Fri, 23 Sep 2022 15:49:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 33B483857B8D Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id DCB09116428; Fri, 23 Sep 2022 11:49:25 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id wMcmBZIyrc6R; Fri, 23 Sep 2022 11:49:25 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) by rock.gnat.com (Postfix) with ESMTP id F03EE1163FB; Fri, 23 Sep 2022 11:49:24 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4216) id EC3DB596; Fri, 23 Sep 2022 11:49:24 -0400 (EDT) Date: Fri, 23 Sep 2022 11:49:24 -0400 To: gcc-patches@gcc.gnu.org Subject: =?iso-8859-1?q?=5Bpatch=5D=A0Fix?= thinko in powerpc default specs for -mabi Message-ID: <20220923154924.GA66899@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Olivier Hainque via Gcc-patches From: Olivier Hainque Reply-To: Olivier Hainque Cc: Segher Boessenkool Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1744776159050121787?= X-GMAIL-MSGID: =?utf-8?q?1744776159050121787?= Hello, For a powerpc compiler configured with --with-abi=elfv2, an explicit -mabi option other than elfv1 fails to override the default. For example, after [...]/configure --enable-languages=c --target=powerpc-elf --with-abi=elfv2 make all-gcc This command: ./gcc/xgcc -B./gcc/ t.c -mabi=ieeelongdouble -v issues: ./gcc/cc1 [...] t.c -mabi=ieeelongdouble -mabi=elfv2 elfv2 overrides the user request here, which I think is not as intended. This is controlled by OPTION_DEFAULT_SPECS, where we have {"abi", "%{!mabi=elfv*:-mabi=%(VALUE)}" }, From https://gcc.gnu.org/pipermail/gcc-patches/2013-November/375042.html I don't see an explicit reason to trigger only on elfv* . It just looks like an oversight with a focus on elfv1 vs elfv2 at the time. The attached patch is a proposal to correct this, simply removing the "elfv" prefix from the spec and adding the corresponding description to the block comment just above. We have been using this for about a year now in gcc-11 based toolchains. This helps our dejagnu testsuite runs for VxWorks on powerpc and hasn't produced any ill side effect to date. The patch also bootstraps and regtests fine on powerpc64-linux. Is this OK to commit? Thanks in advance! With Kind Regards, Olivier 2022-09-14 Olivier Hainque * config/rs6000/option-defaults.h (OPTION_DEFAULT_SPECS): Have any -mabi, not only -mabi=elfv*, override the --with-abi configuration default. commit 33933796b777591007c04448860e781ac17b9070 Author: Olivier Hainque AuthorDate: Thu Apr 21 14:44:47 2022 +0000 Commit: Olivier Hainque CommitDate: Thu Apr 21 14:47:37 2022 +0000 Fix thinko in --with-abi processing on powerpc Make it so any -mabi overrides what --with-abi requests as a default, not only -mabi=elfv*. Part of V415-021 (-mabi overrides on powerpc) Change-Id: I62763dee62bbbd7d446f2dd091017d0c7e719cab diff --git a/gcc/config/rs6000/option-defaults.h b/gcc/config/rs6000/option-defaults.h index 7ebd115755a..ecf246e6b2e 100644 --- a/gcc/config/rs6000/option-defaults.h +++ b/gcc/config/rs6000/option-defaults.h @@ -47,6 +47,7 @@ #endif /* Support for a compile-time default CPU, et cetera. The rules are: + --with-abi is ignored if -mabi is specified. --with-cpu is ignored if -mcpu is specified; likewise --with-cpu-32 and --with-cpu-64. --with-tune is ignored if -mtune or -mcpu is specified; likewise @@ -54,7 +55,7 @@ --with-float is ignored if -mhard-float or -msoft-float are specified. */ #define OPTION_DEFAULT_SPECS \ - {"abi", "%{!mabi=elfv*:-mabi=%(VALUE)}" }, \ + {"abi", "%{!mabi=*:-mabi=%(VALUE)}" }, \ {"tune", "%{!mtune=*:%{!mcpu=*:-mtune=%(VALUE)}}" }, \ {"tune_32", "%{" OPT_ARCH32 ":%{!mtune=*:%{!mcpu=*:-mtune=%(VALUE)}}}" }, \ {"tune_64", "%{" OPT_ARCH64 ":%{!mtune=*:%{!mcpu=*:-mtune=%(VALUE)}}}" }, \