public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Palmer Dabbelt <palmer@rivosinc.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] gimple-fold.h: Add missing gimple-iterator.h
Date: Thu, 12 Jan 2023 08:55:15 +0100	[thread overview]
Message-ID: <CAFiYyc2q+c-0uZb-zAskmR_U+M+xQfp-W00ZbLErfjx=j5qHGg@mail.gmail.com> (raw)
In-Reply-To: <20230112014440.19153-1-palmer@rivosinc.com>

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
>

  reply	other threads:[~2023-01-12  7:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12  1:44 Palmer Dabbelt
2023-01-12  7:55 ` Richard Biener [this message]
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='CAFiYyc2q+c-0uZb-zAskmR_U+M+xQfp-W00ZbLErfjx=j5qHGg@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=palmer@rivosinc.com \
    /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).