public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/41616] New: Variables promoted to Gimple registers by aliasing are not getting debug statements.
@ 2009-10-07 9:17 hubicka at gcc dot gnu dot org
2009-10-07 11:26 ` [Bug debug/41616] " hubicka at ucw dot cz
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2009-10-07 9:17 UTC (permalink / raw)
To: gcc-bugs
In the following testcase:
inline int f(int *a)
{
return *a;
}
main()
{
int b=1;
return f(&b);
}
We ought to be able to track that value of "b" is 1. However we do not:
main ()
{
<bb 2>:
# DEBUG a => &b
return 1;
}
--
Summary: Variables promoted to Gimple registers by aliasing are
not getting debug statements.
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
AssignedTo: aoliva at gcc dot gnu dot org
ReportedBy: hubicka at gcc dot gnu dot org
GCC host triplet: x86_64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41616
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug debug/41616] Variables promoted to Gimple registers by aliasing are not getting debug statements.
2009-10-07 9:17 [Bug debug/41616] New: Variables promoted to Gimple registers by aliasing are not getting debug statements hubicka at gcc dot gnu dot org
@ 2009-10-07 11:26 ` hubicka at ucw dot cz
2009-10-08 21:34 ` aoliva at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: hubicka at ucw dot cz @ 2009-10-07 11:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from hubicka at ucw dot cz 2009-10-07 11:26 -------
Subject: Re: New: Variables promoted to Gimple registers by aliasing are not
getting debug statements.
> We ought to be able to track that value of "b" is 1. However we do not:
> main ()
> {
> <bb 2>:
> # DEBUG a => &b
Note that Richi was mentioning that &b is invalid given that b is
register. I think it is OK - the ADDR_EXPRs in DEBUG statements does
not count as dereferences.
However we sould be able to track here a => &1 and at dwarf2out time try
to look up 1 in constant pool if there. For integer constants this is
unlikely going to win, but for i.e. string constants this is quite
common case we might get better debug info. The tree expansion facility
now has neccesary code to do that, I can put it into RTL expansion too.
Honza
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41616
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug debug/41616] Variables promoted to Gimple registers by aliasing are not getting debug statements.
2009-10-07 9:17 [Bug debug/41616] New: Variables promoted to Gimple registers by aliasing are not getting debug statements hubicka at gcc dot gnu dot org
2009-10-07 11:26 ` [Bug debug/41616] " hubicka at ucw dot cz
@ 2009-10-08 21:34 ` aoliva at gcc dot gnu dot org
2009-10-12 5:15 ` aoliva at gcc dot gnu dot org
2009-10-12 18:22 ` aoliva at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: aoliva at gcc dot gnu dot org @ 2009-10-08 21:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from aoliva at gcc dot gnu dot org 2009-10-08 21:34 -------
Yup, ADDR_EXPRs don't count as dereferences in debug stmts, but if the variable
doesn't get a memory location, we end up dropping the whole expression. We
have to. Finding another location holding the value of b isn't enough if the
relevant value is the address of b. Since b did not get a memory location, its
address is non-existent.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41616
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug debug/41616] Variables promoted to Gimple registers by aliasing are not getting debug statements.
2009-10-07 9:17 [Bug debug/41616] New: Variables promoted to Gimple registers by aliasing are not getting debug statements hubicka at gcc dot gnu dot org
2009-10-07 11:26 ` [Bug debug/41616] " hubicka at ucw dot cz
2009-10-08 21:34 ` aoliva at gcc dot gnu dot org
@ 2009-10-12 5:15 ` aoliva at gcc dot gnu dot org
2009-10-12 18:22 ` aoliva at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: aoliva at gcc dot gnu dot org @ 2009-10-12 5:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from aoliva at gcc dot gnu dot org 2009-10-12 05:15 -------
Subject: Bug 41616
Author: aoliva
Date: Mon Oct 12 05:15:02 2009
New Revision: 152662
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152662
Log:
gcc/ChangeLog:
PR debug/41616
* tree-into-ssa.c (insert_phi_nodes_for): Build debug bind stmts
on updates too.
(maybe_register_def): Likewise. Take stmt iterator.
(rewrite_update_stmt): Take stmt iterator and pass it on.
(rewrite_update_enter_block): Pass stmt iterator.
gcc/testsuite/ChangeLog:
PR debug/41616
* gcc.dg/guality/pr41616-1.c: New.
Added:
trunk/gcc/testsuite/gcc.dg/guality/pr41616-1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-into-ssa.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41616
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug debug/41616] Variables promoted to Gimple registers by aliasing are not getting debug statements.
2009-10-07 9:17 [Bug debug/41616] New: Variables promoted to Gimple registers by aliasing are not getting debug statements hubicka at gcc dot gnu dot org
` (2 preceding siblings ...)
2009-10-12 5:15 ` aoliva at gcc dot gnu dot org
@ 2009-10-12 18:22 ` aoliva at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: aoliva at gcc dot gnu dot org @ 2009-10-12 18:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from aoliva at gcc dot gnu dot org 2009-10-12 18:22 -------
Fixed.
--
aoliva at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |aoliva at gcc dot gnu dot
| |org
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41616
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-10-12 18:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-07 9:17 [Bug debug/41616] New: Variables promoted to Gimple registers by aliasing are not getting debug statements hubicka at gcc dot gnu dot org
2009-10-07 11:26 ` [Bug debug/41616] " hubicka at ucw dot cz
2009-10-08 21:34 ` aoliva at gcc dot gnu dot org
2009-10-12 5:15 ` aoliva at gcc dot gnu dot org
2009-10-12 18:22 ` aoliva 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).