public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Palmer Dabbelt <palmer@rivosinc.com>
To: gcc-patches@gcc.gnu.org
Cc: Palmer Dabbelt <palmer@rivosinc.com>
Subject: [PATCH] gimple-fold.h: Add missing gimple-iterator.h
Date: Wed, 11 Jan 2023 17:44:40 -0800	[thread overview]
Message-ID: <20230112014440.19153-1-palmer@rivosinc.com> (raw)

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"

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);
-- 
2.39.0


             reply	other threads:[~2023-01-12  1:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12  1:44 Palmer Dabbelt [this message]
2023-01-12  7:55 ` Richard Biener
2023-01-13 17:31   ` Palmer Dabbelt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230112014440.19153-1-palmer@rivosinc.com \
    --to=palmer@rivosinc.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).