]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
debug/103047 - argument order of inlined functions
authorRichard Biener <rguenther@suse.de>
Fri, 26 Jan 2024 14:11:47 +0000 (15:11 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 29 Jan 2024 07:41:20 +0000 (08:41 +0100)
The inliner puts variables for parameters of the inlined functions
in the inline scope in reverse order.  The following reverses them
again so that we get consistent ordering between the
DW_TAG_subprogram DW_TAG_formal_parameter and the
DW_TAG_inlined_subroutine DW_TAG_formal_parameter set.

I failed to create a testcase with regexps since the inline
instances have just abstract origins and so I can't match them up.

PR debug/103047
* tree-inline.cc (initialize_inlined_parameters): Reverse
the decl chain of inlined parameters.

gcc/tree-inline.cc

index 1a2541ad95238ef1b0cee94edbbcc38c92ad6d8b..75c10eb7dfc2d99c00a661cee941e8e00cf67f59 100644 (file)
@@ -3684,6 +3684,10 @@ initialize_inlined_parameters (copy_body_data *id, gimple *stmt,
       setup_one_parameter (id, p, static_chain, fn, bb, &vars);
     }
 
+  /* Reverse so the variables appear in the correct order in DWARF
+     debug info.  */
+  vars = nreverse (vars);
+
   declare_inline_vars (id->block, vars);
 }