diff mbox series

[fortran,committed] Set DECL_ARTIFICIAL on auxiliary variables

Message ID 2ff930d2-6cef-989a-a12c-86131ac0b67c@tkoenig.net
State New
Headers show
Series [fortran,committed] Set DECL_ARTIFICIAL on auxiliary variables | expand

Commit Message

Thomas König Dec. 20, 2020, 3:31 p.m. UTC
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.
diff mbox series

Patch

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.  */