* [PATCH] debug/103047 - argument order of inlined functions
@ 2024-01-26 14:16 Richard Biener
2024-01-26 14:18 ` Jakub Jelinek
0 siblings, 1 reply; 2+ messages in thread
From: Richard Biener @ 2024-01-26 14:16 UTC (permalink / raw)
To: gcc-patches; +Cc: Jakub Jelinek
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.
Bootstrap & regtest running on x86_64-unknown-linux-gnu.
OK if that succeeds?
Thanks,
Richard.
PR debug/103047
* tree-inline.cc (initialize_inlined_parameters): Reverse
the decl chain of inlined parameters.
---
gcc/tree-inline.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gcc/tree-inline.cc b/gcc/tree-inline.cc
index 1a2541ad952..75c10eb7dfc 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);
}
--
2.35.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] debug/103047 - argument order of inlined functions
2024-01-26 14:16 [PATCH] debug/103047 - argument order of inlined functions Richard Biener
@ 2024-01-26 14:18 ` Jakub Jelinek
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2024-01-26 14:18 UTC (permalink / raw)
To: Richard Biener; +Cc: gcc-patches
On Fri, Jan 26, 2024 at 03:16:15PM +0100, Richard Biener wrote:
> 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.
>
> Bootstrap & regtest running on x86_64-unknown-linux-gnu.
>
> OK if that succeeds?
>
> Thanks,
> Richard.
>
> PR debug/103047
> * tree-inline.cc (initialize_inlined_parameters): Reverse
> the decl chain of inlined parameters.
LGTM.
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-26 14:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-26 14:16 [PATCH] debug/103047 - argument order of inlined functions Richard Biener
2024-01-26 14:18 ` Jakub Jelinek
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).