aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-01-26 15:11:47 +0100
committerRichard Biener <rguenther@suse.de>2024-01-29 08:41:20 +0100
commitb702dc980215074a06535e3aa52a766bef38af4c (patch)
treed8f143c6a3d7ad24a11450ee5852b962dfdf0b6e
parent5b393ac7f1715328ee92236071edc3885bf53317 (diff)
downloadgcc-b702dc980215074a06535e3aa52a766bef38af4c.zip
gcc-b702dc980215074a06535e3aa52a766bef38af4c.tar.gz
gcc-b702dc980215074a06535e3aa52a766bef38af4c.tar.bz2
debug/103047 - argument order of inlined functions
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.
-rw-r--r--gcc/tree-inline.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc
index 1a2541a..75c10eb 100644
--- a/gcc/tree-inline.cc
+++ b/gcc/tree-inline.cc
@@ -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);
}