public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Pierre-Marie de Rodat <derodat@adacore.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 1/2] gimplify_modify_expr: avoid DECL_DEBUG_EXPR links across functions
Date: Tue, 30 May 2017 11:59:00 -0000	[thread overview]
Message-ID: <CAFiYyc3O3hvfxy_21zsVX849dsmdNM6SuQ=82hjWGUYoxfN17Q@mail.gmail.com> (raw)
In-Reply-To: <20170529075011.15538-1-derodat@adacore.com>

On Mon, May 29, 2017 at 9:50 AM, Pierre-Marie de Rodat
<derodat@adacore.com> wrote:
> Hello,
>
> An upcoming patch exposes a bug in gimplify_modify_expr.  There, we try
> not to create DECL_DEBUG_EXPR links across functions, however we don't
> check that *FROM_P actually belongs to the current function before
> modifying it.  This patch fixes this oversight.
>
> Bootstrapped and regtested on x86_64-linux.  Ok to commit?  Thank you in
> advance!

Ok.

Richard.

> gcc/
>
>         * gimplify.c (gimplify_modify_expr): Don't create a
>         DECL_DEBUG_EXPR link if *FROM_P does not belong to the current
>         function.
> ---
>  gcc/gimplify.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/gimplify.c b/gcc/gimplify.c
> index 455a6993e15..2c7fc9fabd1 100644
> --- a/gcc/gimplify.c
> +++ b/gcc/gimplify.c
> @@ -5580,7 +5580,8 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
>        && DECL_IGNORED_P (*from_p)
>        && DECL_P (*to_p)
>        && !DECL_IGNORED_P (*to_p)
> -      && decl_function_context (*to_p) == current_function_decl)
> +      && decl_function_context (*to_p) == current_function_decl
> +      && decl_function_context (*from_p) == current_function_decl)
>      {
>        if (!DECL_NAME (*from_p) && DECL_NAME (*to_p))
>         DECL_NAME (*from_p)
> --
> 2.13.0
>

  parent reply	other threads:[~2017-05-30 11:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29  7:50 Pierre-Marie de Rodat
2017-05-29  8:05 ` [PATCH 2/2] DWARF: make it possible to emit debug info for declarations only Pierre-Marie de Rodat
2017-05-29 13:39   ` Pierre-Marie de Rodat
2017-05-30 12:11   ` Richard Biener
2017-05-30 15:51     ` Pierre-Marie de Rodat
2017-05-31  7:37       ` Richard Biener
2017-05-31  9:12         ` Pierre-Marie de Rodat
2017-06-16 16:35           ` Pierre-Marie de Rodat
2017-06-20 12:16             ` Richard Biener
2017-06-20 14:34               ` Pierre-Marie de Rodat
2017-06-21  7:11                 ` Richard Biener
2017-06-21 11:25                   ` Pierre-Marie de Rodat
2017-05-30 11:59 ` Richard Biener [this message]
2017-05-30 15:35   ` [PATCH 1/2] gimplify_modify_expr: avoid DECL_DEBUG_EXPR links across functions Pierre-Marie de Rodat

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='CAFiYyc3O3hvfxy_21zsVX849dsmdNM6SuQ=82hjWGUYoxfN17Q@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=derodat@adacore.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).