public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Thomas König" <tk@tkoenig.net>
To: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [patch, fortran, committed] Set DECL_ARTIFICIAL on auxiliary variables
Date: Sun, 20 Dec 2020 16:31:03 +0100	[thread overview]
Message-ID: <2ff930d2-6cef-989a-a12c-86131ac0b67c@tkoenig.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

Hello world,

committed to trunk as obvious and simple.

Best regards

	Thomas

Set DECL_ARTIFICIAL on gfortran internal variables.

It seems we sometimes use DECL_ARTIFICIAL as choosing between
different code paths.  In order not to make -fdebug-aux-vars
do different things, set DECL_ARTIFICIAL on the variables to
avoid these different code paths (and the corresponding
regressions).

gcc/fortran/ChangeLog:

	* trans.c (create_var_debug_raw): Set DECL_ARTIFICIAL
	on variables.


[-- Attachment #2: p2.diff --]
[-- Type: text/x-patch, Size: 484 bytes --]

diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index fa7fd9d88aa..57a344a63c9 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -128,6 +128,9 @@ create_var_debug_raw (tree type, const char *prefix)
 
   t = build_decl (input_location, VAR_DECL, get_identifier (name_buf), type);
 
+  /* Not setting this causes some regressions.  */
+  DECL_ARTIFICIAL (t) = 1;
+
   /* We want debug info for it.  */
   DECL_IGNORED_P (t) = 0;
   /* It should not be nameless.  */

                 reply	other threads:[~2020-12-20 15:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=2ff930d2-6cef-989a-a12c-86131ac0b67c@tkoenig.net \
    --to=tk@tkoenig.net \
    --cc=fortran@gcc.gnu.org \
    --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).