public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/43329] New: Early inlining causes suboptimal debug info
@ 2010-03-10 23:28 jakub at gcc dot gnu dot org
2010-03-10 23:30 ` [Bug debug/43329] " jakub at gcc dot gnu dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-03-10 23:28 UTC (permalink / raw)
To: gcc-bugs
The following testcase doesn't contain DW_AT_const_value for arrg3 nor min when
early inlining is used, while when normal inlining is performed all is fine.
-g -O2 --param early-inlining-insns=32 (doesn't work) vs.
-g -O2 --param early-inlining-insns=32 -fno-early-inlining
Sorry for the extra parameter, but the testcase was reported against 4.4-RH
which does 4.4-ish inlining decisions, so it needs some tweaks to get the same
effect in 4.5.
For arrg3, there are DEBUG stmts (and even var-tracking produces locations for
it), but dwarf2out ignores them, as the var has been non-localized (var_ann has
been NULL). For min argument, a DEBUG stmt only appears when not using early
inlining.
--
Summary: Early inlining causes suboptimal debug info
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Keywords: wrong-debug
Severity: normal
Priority: P3
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jakub at gcc dot gnu dot org
GCC target triplet: x86_64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43329
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug debug/43329] Early inlining causes suboptimal debug info
2010-03-10 23:28 [Bug debug/43329] New: Early inlining causes suboptimal debug info jakub at gcc dot gnu dot org
@ 2010-03-10 23:30 ` jakub at gcc dot gnu dot org
2010-03-11 12:53 ` jakub at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-03-10 23:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from jakub at gcc dot gnu dot org 2010-03-10 23:29 -------
Created an attachment (id=20078)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20078&action=view)
rh572260.ii
Testcase.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43329
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug debug/43329] Early inlining causes suboptimal debug info
2010-03-10 23:28 [Bug debug/43329] New: Early inlining causes suboptimal debug info jakub at gcc dot gnu dot org
2010-03-10 23:30 ` [Bug debug/43329] " jakub at gcc dot gnu dot org
@ 2010-03-11 12:53 ` jakub at gcc dot gnu dot org
2010-03-11 13:02 ` jakub at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-03-11 12:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from jakub at gcc dot gnu dot org 2010-03-11 12:53 -------
The problem is that with early inlining, method (&inst, 24) call is inlined
into
call function, then at the end of einline during arrg3 and min vars in call are
removed as unused locals by remove_unused_locals (the inline asm uses 24
directly, so arrg3 is only referenced in DEBUG stmts, not sure why min didn't
have any DEBUG stmts even generated). Then when in the normal inliner call is
inlined into main, both arrg3 and min are non-localized because their var_ann
is NULL. And for non-localized vars dwarf2out isn't able to find the
dwarf2out_var_location tracked values.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43329
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug debug/43329] Early inlining causes suboptimal debug info
2010-03-10 23:28 [Bug debug/43329] New: Early inlining causes suboptimal debug info jakub at gcc dot gnu dot org
2010-03-10 23:30 ` [Bug debug/43329] " jakub at gcc dot gnu dot org
2010-03-11 12:53 ` jakub at gcc dot gnu dot org
@ 2010-03-11 13:02 ` jakub at gcc dot gnu dot org
2010-03-11 14:47 ` jakub at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-03-11 13:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jakub at gcc dot gnu dot org 2010-03-11 13:02 -------
Wonder why we do
548 VEC_safe_push (tree, gc, *nonlocalized_list, origin_var);
instead of
548 VEC_safe_push (tree, gc, *nonlocalized_list, old_var);
The latter perhaps would need some adjustments in dwarf2out.c, but would allow
it to find the location.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43329
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug debug/43329] Early inlining causes suboptimal debug info
2010-03-10 23:28 [Bug debug/43329] New: Early inlining causes suboptimal debug info jakub at gcc dot gnu dot org
` (2 preceding siblings ...)
2010-03-11 13:02 ` jakub at gcc dot gnu dot org
@ 2010-03-11 14:47 ` jakub at gcc dot gnu dot org
2010-03-11 16:08 ` jakub at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-03-11 14:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jakub at gcc dot gnu dot org 2010-03-11 14:46 -------
Created an attachment (id=20081)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20081&action=view)
gcc45-pr43329.patch
This patch worked on this testcase. Note that the missing min (and this) DEBUG
stmts are caused by remove_forwarder_block nuking it. Looking into that...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43329
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug debug/43329] Early inlining causes suboptimal debug info
2010-03-10 23:28 [Bug debug/43329] New: Early inlining causes suboptimal debug info jakub at gcc dot gnu dot org
` (3 preceding siblings ...)
2010-03-11 14:47 ` jakub at gcc dot gnu dot org
@ 2010-03-11 16:08 ` jakub at gcc dot gnu dot org
2010-03-12 13:05 ` jakub at gcc dot gnu dot org
2010-03-12 23:06 ` jakub at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-03-11 16:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jakub at gcc dot gnu dot org 2010-03-11 16:08 -------
Created an attachment (id=20084)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20084&action=view)
gcc45-pr43329.patch
Updated patch that also fixes remove_forwarder_block and adds a testcase.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #20081|0 |1
is obsolete| |
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
Status|UNCONFIRMED |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43329
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug debug/43329] Early inlining causes suboptimal debug info
2010-03-10 23:28 [Bug debug/43329] New: Early inlining causes suboptimal debug info jakub at gcc dot gnu dot org
` (4 preceding siblings ...)
2010-03-11 16:08 ` jakub at gcc dot gnu dot org
@ 2010-03-12 13:05 ` jakub at gcc dot gnu dot org
2010-03-12 23:06 ` jakub at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-03-12 13:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jakub at gcc dot gnu dot org 2010-03-12 13:04 -------
Subject: Bug 43329
Author: jakub
Date: Fri Mar 12 13:04:37 2010
New Revision: 157402
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157402
Log:
PR debug/43329
* tree-inline.c (remap_decls): Put old_var rather than origin_var
into *nonlocalized_list vector.
* dwarf2out.c (gen_formal_parameter_die): Call decl_ultimate_origin
even if origin is non-NULL.
(gen_variable_die): Likewise.
(process_scope_var): Don't change origin.
(gen_decl_die): Likewise.
* tree-cfgcleanup.c (remove_forwarder_block): Check single_pred_p
before adding new edges instead of after it, fix moving over
debug stmts.
* gcc.dg/guality/pr43329-1.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/guality/pr43329-1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-cfgcleanup.c
trunk/gcc/tree-inline.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43329
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug debug/43329] Early inlining causes suboptimal debug info
2010-03-10 23:28 [Bug debug/43329] New: Early inlining causes suboptimal debug info jakub at gcc dot gnu dot org
` (5 preceding siblings ...)
2010-03-12 13:05 ` jakub at gcc dot gnu dot org
@ 2010-03-12 23:06 ` jakub at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-03-12 23:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jakub at gcc dot gnu dot org 2010-03-12 23:06 -------
Fixed.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43329
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-03-12 23:06 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-10 23:28 [Bug debug/43329] New: Early inlining causes suboptimal debug info jakub at gcc dot gnu dot org
2010-03-10 23:30 ` [Bug debug/43329] " jakub at gcc dot gnu dot org
2010-03-11 12:53 ` jakub at gcc dot gnu dot org
2010-03-11 13:02 ` jakub at gcc dot gnu dot org
2010-03-11 14:47 ` jakub at gcc dot gnu dot org
2010-03-11 16:08 ` jakub at gcc dot gnu dot org
2010-03-12 13:05 ` jakub at gcc dot gnu dot org
2010-03-12 23:06 ` jakub at gcc dot gnu dot org
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).