From patchwork Sun Apr 28 08:23:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1928612 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=Xh7Vbhap; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VRzym11jXz23jG for ; Sun, 28 Apr 2024 18:24:32 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 524BC3858D37 for ; Sun, 28 Apr 2024 08:24:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by sourceware.org (Postfix) with ESMTPS id 235B63858D33 for ; Sun, 28 Apr 2024 08:23:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 235B63858D33 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 235B63858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::529 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714292641; cv=none; b=iKGhmFMKM7id81UPglvti84elXj0RBGOyz8KsbkThtY6YRvIlHrr4Vuqkgmu7OuMkQyrJ980ToISt+S8jdIu1jooEBKQLqFkT2TZ43WbNr5CJmiyYNe0hDTpTnippGd+gjKTw3VaXWdk/1pjzCvrb7C04HG8ZpmtkagDd+lNzqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714292641; c=relaxed/simple; bh=j0DcwzWCc9XC7WNgrmoF1qgn5cduBHL/b3Xw5/z25ks=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lS/HBejwEcwyK/kF7O7sfMfGEdnLNIubBBi6AqQ4e9YMd/grfNY0U6vNY34vBQPIiP1AKjShXOCWBGbHJ5epCBtzgpIvSqQLFkpLTbdwbShJNfNsPvryhchyiNnzHTZIAiEsohnfcMxIWXwYQAwzNU814BquFGf/XS8kg1v5IE8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-5ce6b5e3c4eso2066368a12.2 for ; Sun, 28 Apr 2024 01:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1714292638; x=1714897438; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:date:organization:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=CrmmGgIR4i3jLi2aEsgcO4/1Rj9JK7W1SqniGrULG5I=; b=Xh7Vbhapfk9J/JRg9STXBlPY5YUqMm9h6tXS2i0y6xWv9QegUWLTYrP0dAredkul7k kX0RQ5jggKWRBQwwZAPdkJaS5MpaKscvPlc7SoHk19RBKF1nFh/wTpkjqSu43PZBSN2s uMFH/fME+/lpIagU4zLGbzRCLb5rytahf8a8zwh5jLCtVYn9v5NhdbHGtyUI7gkMVxPf t1qNTIpGl/MhnIun7E5WkI32obcd2LLjII1FwGXbOZWyqbcRzf0iF0BsyvBuoMfY7O7F vfcAM7alv6LFcO6quu9eT3rox290ovk+yKMr9uWDFsSQqQ5UtPVExz+O2VfWC0QQSQdU R+Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714292638; x=1714897438; h=mime-version:user-agent:message-id:date:organization:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CrmmGgIR4i3jLi2aEsgcO4/1Rj9JK7W1SqniGrULG5I=; b=CDEyzvL9TljK1TGnAgJm/x/ZAoarRiUFHE+8f1yvDOpAeZUQVkAoba4eQomYZ8qAWh 2laHjI+uMa+GmDzX9etegNhW4f0BX47+tmMegKFCIUZGRwnexaXP3aj7w+L27Qqdw3C+ YjuZNtT29VA0KRJ0GfcO3o9hkS7cz6EOFoa3UyB/oMkDfHyxHitKAAJ4uPyK67Ty5X9x s1flQZUtOfkwXV1qp1fCzpxQFmvgAozZSEWmypLE0LD5XwS2PdWKFrb+EXiuJ2lwRcJt X2p93kFqvX4Id64Vq3/mwuXfV28n+Gvq8e4FySRCQAL48PGoiz73WQCDeGlmDqp0bs2z GFWw== X-Gm-Message-State: AOJu0YwcuYBjlN069B0U7DGirgdCQgwGfmDHWSyEs32yp/B7tog0nqzJ WEEeSvJAmKnbiW0iT4TCDS9GZEgrx+yQKqM3A3LIX3mEBjmpLO2EKqtD2Qwv0EYa1RvY7MOTaKk eQQ== X-Google-Smtp-Source: AGHT+IEwJTD9YmBrsyo9u7rRQYbws/9jqpWUCnmIBEbB8wV/S4DAoxu6yXLNoPFxYS7iZoDVdVtAHg== X-Received: by 2002:a17:903:32cb:b0:1e5:2a20:2d68 with SMTP id i11-20020a17090332cb00b001e52a202d68mr8347622plr.47.1714292638013; Sun, 28 Apr 2024 01:23:58 -0700 (PDT) Received: from free.home ([2804:7f1:218b:5e2:c43b:e0c4:71a:241b]) by smtp.gmail.com with ESMTPSA id n2-20020a170902d2c200b001e826e4d087sm18095975plc.142.2024.04.28.01.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 01:23:57 -0700 (PDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 43S8NjnR279438 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sun, 28 Apr 2024 05:23:46 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: [PATCH] make -freg-struct-return visibly a negative alias of -fpcc-struct-return Organization: Free thinker, does not speak for AdaCore Date: Sun, 28 Apr 2024 05:23:45 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, WEIRD_QUOTING 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org The fact that both options accept negative forms suggests that maybe they aren't negative forms of each other. They are, but that isn't clear even by examining common.opt. Use NegativeAlias to make it abundantly clear. The 'Optimization' keyword next to freg-struct-return was the only thing that caused flag_pcc_struct_return to be a per-function flag, and ipa-inline relied on that. After making it an alias, the Optimization keyword was no longer operational. I'm not sure it was sensible or desirable for flag_pcc_struct_return to be a per-function setting, but this patch does not intend to change behavior. Regstrapped on x86_64-linux-gnu and ppc64le-linux-gnu. Ok to install? for gcc/ChangeLog * common.opt (freg-struct-return): Make it explicitly fpcc-struct-return's NegativeAlias. Copy Optimization... (freg-struct-return): ... here. --- gcc/common.opt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt index ad3488447752b..12d93c76a1e63 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -2406,7 +2406,7 @@ Common RejectNegative Joined UInteger Optimization -fpack-struct= Set initial maximum structure member alignment. fpcc-struct-return -Common Var(flag_pcc_struct_return,1) Init(DEFAULT_PCC_STRUCT_RETURN) +Common Var(flag_pcc_struct_return,1) Init(DEFAULT_PCC_STRUCT_RETURN) Optimization Return small aggregates in memory, not registers. fpeel-loops @@ -2596,7 +2596,7 @@ Common Var(flag_record_gcc_switches) Record gcc command line switches in the object file. freg-struct-return -Common Var(flag_pcc_struct_return,0) Optimization +Common NegativeAlias Alias(fpcc_struct_return) Optimization Return small aggregates in registers. fregmove