Message ID | 20230112014440.19153-1-palmer@rivosinc.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3638016wrt; Wed, 11 Jan 2023 17:46:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXtFxfAcSSDNKzC9D+F/OU7ag/Naw1snvT+M8wkq7jg+6MBQ9IOm6Txdbzj1MpAfNM8rumDB X-Received: by 2002:a17:907:3e96:b0:7c4:f501:e5b1 with SMTP id hs22-20020a1709073e9600b007c4f501e5b1mr84775583ejc.51.1673487988615; Wed, 11 Jan 2023 17:46:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673487988; cv=none; d=google.com; s=arc-20160816; b=gh6v0sEVgv1GJ3p6hQGXIzjFY4dEC6dbQJ1MJcHrqm15yYfKfEW98oAS/cnrdG641x uSiYSWY79lxH07OjwZoYt5nXnzUcx1H0z7zco1dK/oM8Ip5myCs4BDGbK90f91aDqMzq cBNv24DI+slhzA7yevmGWgE2TrbWXeSE4QnXqiyM1Z9/MY0AcKaSvhAm/nE3cEVm3EZf 5C+7ar1Ch+KqvHPine8V/yNjYLKU2qa/KDEyybCrUhcdWH91ZuE/BMTE6sc5M1qapfAF nSwR/YSwlli8D+VXoytyIupc1CyuhM/SoDWM2ywUjM8x/anIqpR3rKNavV9ay+cMlWaD SK6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:to:from:cc :content-transfer-encoding:mime-version:message-id:date:subject :dkim-signature:dmarc-filter:delivered-to; bh=wRsd8WpPIdq1BsdNYCdojuYQzL3YH9UbsVFR5uq5ikM=; b=vMRCjXse3LNR2EcbKepQlwyQ5TOmlBSWRVmGviTlQiMWD3mdycJ/cltokOBC8FqGGm AjGs5dUg2tTs6DiUuREm+x1aafgpUAsM0N2tOg6z59GkLJVQGlWdBT5q8wj8yh+QcrWY AMQcmQ4eYhbdg+UVa2Z4C6eHVDgeb5wMpEhYbvg/T3OsV1B+4sRhamYsrQC1gdJzdPYn 0ithmu3iZ1RT0sKgPXscfFb7WO7qqgz9HFGpdrlCmfk+Vv3V2cF6CCASAmIDVB1M6ZRA aI5H89ob7syZC1TLOpBtW2KY9Tj6Uj/UEkhSOTZHVzjtFDtTDHRuQbPJnLWYUVSmY6ev yIdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=zaWoXVWx; 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" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id sg18-20020a170907a41200b008650ce2977bsi915099ejc.641.2023.01.11.17.46.28 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 17:46:28 -0800 (PST) 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=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=zaWoXVWx; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 97C20385B51F for <ouuuleilei@gmail.com>; Thu, 12 Jan 2023 01:46:24 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 954743858D20 for <gcc-patches@gcc.gnu.org>; Thu, 12 Jan 2023 01:45:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 954743858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pf1-x433.google.com with SMTP id g20so12765759pfb.3 for <gcc-patches@gcc.gnu.org>; Wed, 11 Jan 2023 17:45:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:from:to:cc:subject:date:message-id:reply-to; bh=wRsd8WpPIdq1BsdNYCdojuYQzL3YH9UbsVFR5uq5ikM=; b=zaWoXVWxJZu1aKWQ0zFaIDGBDI2XpZXvEXTqpxA0aZCxNIwjfgm7Tqn+rrO3prOexs RKE53h2UTJgOfliGa8IOh10k3YWTSjOCHB0y6iD/2kojh1o37B6TL+HmbW3QkX5xeHfC xi2Ic8FVDJD/r6gZIYvRsPSsUgaiEKdX3HnH7rjzDRBLkVZjAvqSi6qYExXpHAfMIBsk TNneVhsH6YxnXmRwfTH3UzBn56fCpMwiGzNRrmtrMoG+rAQvH12g94xLn9uxc7+2TqzV lSRuyOlmRxR9ebIK9hoadz8VDhkynCBse4AI3qkqSn0UAoCQhDPi/+4wnw2U0Xt2uFA/ vbjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wRsd8WpPIdq1BsdNYCdojuYQzL3YH9UbsVFR5uq5ikM=; b=CDwA8THn9QX5k//i51WANUEwLhT2WRxEBxbEZzJnvujF/DguNFKgtwoGfbnT9RcTBo MLFlpCFpUwtwRm8Q2MH386qq2x57VzT2STisOLWVKI+D+AEVP+1sf7ZnYJVke0TPlBCR opoE1DMonWE8a5gOB1kicpg6ntgP4RYpMUeRoB2nKOCOD4A1zbSh6hLV0eyICPfkhlOF DQ5ARXVCKyhFXrl2Focyq6ryqGdR0M6h27JzuDNYdcKH4XBxgDf/c56eextEqD+jZx5t 34apBIUZYpqWXYbOR6GFlDoNP7FVe8B+FBCSgbj63uUFXOPIwZCLTWBkwetBpqYcbtAx 3Shg== X-Gm-Message-State: AFqh2kqHgcdyTyefYAdWGIzhBVLNqDuQM6G4tfH14WgxVOZ2yS0pSZ9d /N7/lU7rcxVNP8tbQr2Cd8woZfZ9uOuWbfPH X-Received: by 2002:a62:a510:0:b0:58b:9473:7ae0 with SMTP id v16-20020a62a510000000b0058b94737ae0mr3341045pfm.32.1673487957769; Wed, 11 Jan 2023 17:45:57 -0800 (PST) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id 186-20020a6216c3000000b0057fec210d33sm9422605pfw.152.2023.01.11.17.45.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 17:45:57 -0800 (PST) Subject: [PATCH] gimple-fold.h: Add missing gimple-iterator.h Date: Wed, 11 Jan 2023 17:44:40 -0800 Message-Id: <20230112014440.19153-1-palmer@rivosinc.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Palmer Dabbelt <palmer@rivosinc.com> From: Palmer Dabbelt <palmer@rivosinc.com> To: gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754779340864880987?= X-GMAIL-MSGID: =?utf-8?q?1754779340864880987?= |
Series |
gimple-fold.h: Add missing gimple-iterator.h
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Palmer Dabbelt
Jan. 12, 2023, 1:44 a.m. UTC
As of 6f5b06032eb ("Finish gimple_build API enhancement") gimple-fold.h uses some of the declarations from gimple-iterator.h, which causes issues when building Linux's stackprotector plugin. gcc/ChangeLog: * gimple-fold.h: Add gimple-iterator.h include. --- I'm not sure if this should instead be fixed in Linux by reordering the includes along the lines of
Comments
On Thu, Jan 12, 2023 at 2:46 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: > > As of 6f5b06032eb ("Finish gimple_build API enhancement") gimple-fold.h > uses some of the declarations from gimple-iterator.h, which causes > issues when building Linux's stackprotector plugin. > > gcc/ChangeLog: > > * gimple-fold.h: Add gimple-iterator.h include. > > --- > > I'm not sure if this should instead be fixed in Linux by reordering the > includes along the lines of > > diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h > index 9a1895747b15..2c3a3079128a 100644 > --- a/scripts/gcc-plugins/gcc-common.h > +++ b/scripts/gcc-plugins/gcc-common.h > @@ -72,6 +72,7 @@ > #include "stor-layout.h" > #include "internal-fn.h" > #include "gimple-expr.h" > +#include "gimple-iterator.h" > #include "gimple-fold.h" > #include "context.h" > #include "tree-ssa-alias.h" > @@ -88,7 +89,6 @@ > #include "gimple.h" > #include "tree-phinodes.h" > #include "tree-cfg.h" > -#include "gimple-iterator.h" > #include "gimple-ssa.h" > #include "ssa-iterators.h" The above change is OK. > but I figured it was slightly easier for users to keep these compatible. > It looks like many GCC-internal uses of gimple-fold.h already have the > gimple-iterator.h include right before, though, so not sure if that's > how things are meant to be. > --- > gcc/gimple-fold.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/gcc/gimple-fold.h b/gcc/gimple-fold.h > index 2fd58db9a2e..66bee2b75df 100644 > --- a/gcc/gimple-fold.h > +++ b/gcc/gimple-fold.h > @@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. If not see > #ifndef GCC_GIMPLE_FOLD_H > #define GCC_GIMPLE_FOLD_H > > +#include "gimple-iterator.h" > + But this is not - we try to avoid #include directives in headers, we want the include dependences to be "flat" > extern tree create_tmp_reg_or_ssa_name (tree, gimple *stmt = NULL); > extern tree canonicalize_constructor_val (tree, tree); > extern tree get_symbol_constant_value (tree); > -- > 2.39.0 >
On Wed, 11 Jan 2023 23:55:15 PST (-0800), richard.guenther@gmail.com wrote: > On Thu, Jan 12, 2023 at 2:46 AM Palmer Dabbelt <palmer@rivosinc.com> wrote: >> >> As of 6f5b06032eb ("Finish gimple_build API enhancement") gimple-fold.h >> uses some of the declarations from gimple-iterator.h, which causes >> issues when building Linux's stackprotector plugin. >> >> gcc/ChangeLog: >> >> * gimple-fold.h: Add gimple-iterator.h include. >> >> --- >> >> I'm not sure if this should instead be fixed in Linux by reordering the >> includes along the lines of >> >> diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h >> index 9a1895747b15..2c3a3079128a 100644 >> --- a/scripts/gcc-plugins/gcc-common.h >> +++ b/scripts/gcc-plugins/gcc-common.h >> @@ -72,6 +72,7 @@ >> #include "stor-layout.h" >> #include "internal-fn.h" >> #include "gimple-expr.h" >> +#include "gimple-iterator.h" >> #include "gimple-fold.h" >> #include "context.h" >> #include "tree-ssa-alias.h" >> @@ -88,7 +89,6 @@ >> #include "gimple.h" >> #include "tree-phinodes.h" >> #include "tree-cfg.h" >> -#include "gimple-iterator.h" >> #include "gimple-ssa.h" >> #include "ssa-iterators.h" > > The above change is OK. > >> but I figured it was slightly easier for users to keep these compatible. >> It looks like many GCC-internal uses of gimple-fold.h already have the >> gimple-iterator.h include right before, though, so not sure if that's >> how things are meant to be. >> --- >> gcc/gimple-fold.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/gcc/gimple-fold.h b/gcc/gimple-fold.h >> index 2fd58db9a2e..66bee2b75df 100644 >> --- a/gcc/gimple-fold.h >> +++ b/gcc/gimple-fold.h >> @@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. If not see >> #ifndef GCC_GIMPLE_FOLD_H >> #define GCC_GIMPLE_FOLD_H >> >> +#include "gimple-iterator.h" >> + > > But this is not - we try to avoid #include directives in headers, we want the > include dependences to be "flat" Makes sense. I've sent the diff above to Linux: https://lore.kernel.org/r/20230113173033.4380-1-palmer@rivosinc.com/ > >> extern tree create_tmp_reg_or_ssa_name (tree, gimple *stmt = NULL); >> extern tree canonicalize_constructor_val (tree, tree); >> extern tree get_symbol_constant_value (tree); >> -- >> 2.39.0 >>
diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h index 9a1895747b15..2c3a3079128a 100644 --- a/scripts/gcc-plugins/gcc-common.h +++ b/scripts/gcc-plugins/gcc-common.h @@ -72,6 +72,7 @@ #include "stor-layout.h" #include "internal-fn.h" #include "gimple-expr.h" +#include "gimple-iterator.h" #include "gimple-fold.h" #include "context.h" #include "tree-ssa-alias.h" @@ -88,7 +89,6 @@ #include "gimple.h" #include "tree-phinodes.h" #include "tree-cfg.h" -#include "gimple-iterator.h" #include "gimple-ssa.h" #include "ssa-iterators.h" but I figured it was slightly easier for users to keep these compatible. It looks like many GCC-internal uses of gimple-fold.h already have the gimple-iterator.h include right before, though, so not sure if that's how things are meant to be. --- gcc/gimple-fold.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/gimple-fold.h b/gcc/gimple-fold.h index 2fd58db9a2e..66bee2b75df 100644 --- a/gcc/gimple-fold.h +++ b/gcc/gimple-fold.h @@ -22,6 +22,8 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_GIMPLE_FOLD_H #define GCC_GIMPLE_FOLD_H +#include "gimple-iterator.h" + extern tree create_tmp_reg_or_ssa_name (tree, gimple *stmt = NULL); extern tree canonicalize_constructor_val (tree, tree); extern tree get_symbol_constant_value (tree);