public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/54970] New: Missing DW_OP_GNU_implicit_pointer in debuginfo
@ 2012-10-18  8:45 jakub at gcc dot gnu.org
  2012-10-18  8:46 ` [Bug debug/54970] " jakub at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-18  8:45 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54970

             Bug #: 54970
           Summary: Missing DW_OP_GNU_implicit_pointer in debuginfo
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: jakub@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: aoliva@gcc.gnu.org


/* { dg-do run } */
/* { dg-options "-g" } */

#include "../nop.h"

int
main ()
{
  int a[] = { 1, 2, 3 };        /* { dg-final { gdb-test 12 "a\[1\]" "2" } } */
  int *p = a + 2;               /* { dg-final { gdb-test 12 "a\[2\]" "3" } } */
  int *q = a + 1;               /* { dg-final { gdb-test 12 "*p" "3" } } */
  asm volatile ("NOP");         /* { dg-final { gdb-test 12 "*q" "2" } } */
  *p += 10;                     /* { dg-final { gdb-test 16 "a\[1\]" "2" } } */
                                /* { dg-final { gdb-test 16 "a\[2\]" "13" } }
*/
                                /* { dg-final { gdb-test 16 "*p" "13" } } */
  asm volatile ("NOP");         /* { dg-final { gdb-test 16 "*q" "2" } } */
  *q += 10;                     /* { dg-final { gdb-test 20 "a\[1\]" "12" } }
*/
                                /* { dg-final { gdb-test 20 "a\[2\]" "13" } }
*/
                                /* { dg-final { gdb-test 20 "*p" "13" } } */
  asm volatile ("NOP");         /* { dg-final { gdb-test 20 "*q" "12" } } */
  return 0;
}

fails, apparently because we have # DEBUG p => &MEM[(void *)&a + 8B]
and we fail to expand that as (plus (debug_implicit_ptr a) (const_int 8)).
The reason for that is that we don't want (mem (debug_implicit_ptr x)) to
appear
in debug insns, that confuses aliasing.  When expanding &a, we expand it as
DEBUG_IMPLICIT_PTR, but when returning to MEM, we return NULL, as that is not
appropriate thing to construct.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/54970] Missing DW_OP_GNU_implicit_pointer in debuginfo
  2012-10-18  8:45 [Bug debug/54970] New: Missing DW_OP_GNU_implicit_pointer in debuginfo jakub at gcc dot gnu.org
@ 2012-10-18  8:46 ` jakub at gcc dot gnu.org
  2012-10-18  8:55 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-18  8:46 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54970

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-10-18
   Target Milestone|---                         |4.8.0
     Ever Confirmed|0                           |1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/54970] Missing DW_OP_GNU_implicit_pointer in debuginfo
  2012-10-18  8:45 [Bug debug/54970] New: Missing DW_OP_GNU_implicit_pointer in debuginfo jakub at gcc dot gnu.org
  2012-10-18  8:46 ` [Bug debug/54970] " jakub at gcc dot gnu.org
@ 2012-10-18  8:55 ` jakub at gcc dot gnu.org
  2012-10-18  9:27 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-18  8:55 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54970

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-18 08:55:02 UTC ---
Created attachment 28478
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28478
gcc48-pr54970.patch

Untested fix.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/54970] Missing DW_OP_GNU_implicit_pointer in debuginfo
  2012-10-18  8:45 [Bug debug/54970] New: Missing DW_OP_GNU_implicit_pointer in debuginfo jakub at gcc dot gnu.org
  2012-10-18  8:46 ` [Bug debug/54970] " jakub at gcc dot gnu.org
  2012-10-18  8:55 ` jakub at gcc dot gnu.org
@ 2012-10-18  9:27 ` jakub at gcc dot gnu.org
  2012-10-26 19:20 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-18  9:27 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54970

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28478|0                           |1
        is obsolete|                            |

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-18 09:26:54 UTC ---
Created attachment 28479
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28479
gcc48-pr54970.patch

The testcase still fails with -m32 -Os, the problem is that DECL_DEBUG_EXPR
isn't created for the replacements in that case.  This patch adds needed
tree-sra.c and var-tracking.c/dwarf2out.c changes to handle MEM_REFs with
ADDR_EXPR in it too.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/54970] Missing DW_OP_GNU_implicit_pointer in debuginfo
  2012-10-18  8:45 [Bug debug/54970] New: Missing DW_OP_GNU_implicit_pointer in debuginfo jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-10-18  9:27 ` jakub at gcc dot gnu.org
@ 2012-10-26 19:20 ` jakub at gcc dot gnu.org
  2012-11-05 14:37 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-10-26 19:20 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54970

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-10-26 19:19:30 UTC ---
Author: jakub
Date: Fri Oct 26 19:19:25 2012
New Revision: 192860

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192860
Log:
    PR debug/54970
    * cfgexpand.c (expand_debug_expr): Expand &MEM_REF[&var, n]
    as DEBUG_IMPLICIT_PTR + n if &var expands to DEBUG_IMPLICIT_PTR.
    * tree-sra.c (create_access_replacement): Allow also MEM_REFs
    with ADDR_EXPR first operand in DECL_DEBUG_EXPR expressions.
    * var-tracking.c (track_expr_p): Handle MEM_REFs in DECL_DEBUG_EXPR
    expressions.
    * dwarf2out.c (add_var_loc_to_decl): Likewise.

    PR debug/54971
    * gcc.dg/guality/pr54970.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/guality/pr54970.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgexpand.c
    trunk/gcc/dwarf2out.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-sra.c
    trunk/gcc/var-tracking.c


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/54970] Missing DW_OP_GNU_implicit_pointer in debuginfo
  2012-10-18  8:45 [Bug debug/54970] New: Missing DW_OP_GNU_implicit_pointer in debuginfo jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-10-26 19:20 ` jakub at gcc dot gnu.org
@ 2012-11-05 14:37 ` jakub at gcc dot gnu.org
  2012-12-04 13:17 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-05 14:37 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54970

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-05 14:36:52 UTC ---
Author: jakub
Date: Mon Nov  5 14:36:47 2012
New Revision: 193162

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193162
Log:
    PR debug/54970
    PR debug/54971
    * gcc.dg/guality/pr54970.c: Use NOP instead of "NOP" in inline-asm.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/guality/pr54970.c


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/54970] Missing DW_OP_GNU_implicit_pointer in debuginfo
  2012-10-18  8:45 [Bug debug/54970] New: Missing DW_OP_GNU_implicit_pointer in debuginfo jakub at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-11-05 14:37 ` jakub at gcc dot gnu.org
@ 2012-12-04 13:17 ` jakub at gcc dot gnu.org
  2013-03-12 17:09 ` steven at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-12-04 13:17 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54970

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-12-04 13:16:05 UTC ---
Fixed.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/54970] Missing DW_OP_GNU_implicit_pointer in debuginfo
  2012-10-18  8:45 [Bug debug/54970] New: Missing DW_OP_GNU_implicit_pointer in debuginfo jakub at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-12-04 13:17 ` jakub at gcc dot gnu.org
@ 2013-03-12 17:09 ` steven at gcc dot gnu.org
  2013-03-12 17:51 ` jakub at gcc dot gnu.org
  2013-03-12 18:55 ` steven at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: steven at gcc dot gnu.org @ 2013-03-12 17:09 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54970

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #6 from Steven Bosscher <steven at gcc dot gnu.org> 2013-03-12 17:09:14 UTC ---
This test case fails on powerpc64 with fc18.
The *p and *q stores are optimized away.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/54970] Missing DW_OP_GNU_implicit_pointer in debuginfo
  2012-10-18  8:45 [Bug debug/54970] New: Missing DW_OP_GNU_implicit_pointer in debuginfo jakub at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2013-03-12 17:09 ` steven at gcc dot gnu.org
@ 2013-03-12 17:51 ` jakub at gcc dot gnu.org
  2013-03-12 18:55 ` steven at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-03-12 17:51 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54970

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-03-12 17:50:49 UTC ---
The stores are of course optimized away, everywhere, that is the point of the
testcase.
The problems that cause the debug info to be insufficient on some targets are
tracked e.g. in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54971#c13
There is no point to keep this PR open for that.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug debug/54970] Missing DW_OP_GNU_implicit_pointer in debuginfo
  2012-10-18  8:45 [Bug debug/54970] New: Missing DW_OP_GNU_implicit_pointer in debuginfo jakub at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2013-03-12 17:51 ` jakub at gcc dot gnu.org
@ 2013-03-12 18:55 ` steven at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: steven at gcc dot gnu.org @ 2013-03-12 18:55 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54970

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |steven at gcc dot gnu.org

--- Comment #8 from Steven Bosscher <steven at gcc dot gnu.org> 2013-03-12 18:55:19 UTC ---
(In reply to comment #7)
> The stores are of course optimized away, everywhere, that is the point
> of the testcase.

I am talking about the debug_stmts for the stores, sorry if that was not
clear.  On x86_64 the test case passes, but on powerpc64 esra does something
it doesn't do on x86_64 and it makes the test case fail.  Is there a known
bug for that already, also?

This is 176 FAILs on powerpc64.  If it's "supposed to not work" there, then
the test case should be XFAIL'ed there.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-03-12 18:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-18  8:45 [Bug debug/54970] New: Missing DW_OP_GNU_implicit_pointer in debuginfo jakub at gcc dot gnu.org
2012-10-18  8:46 ` [Bug debug/54970] " jakub at gcc dot gnu.org
2012-10-18  8:55 ` jakub at gcc dot gnu.org
2012-10-18  9:27 ` jakub at gcc dot gnu.org
2012-10-26 19:20 ` jakub at gcc dot gnu.org
2012-11-05 14:37 ` jakub at gcc dot gnu.org
2012-12-04 13:17 ` jakub at gcc dot gnu.org
2013-03-12 17:09 ` steven at gcc dot gnu.org
2013-03-12 17:51 ` jakub at gcc dot gnu.org
2013-03-12 18:55 ` steven at gcc dot gnu.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).