public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/44712]  New: Debug info for partially inlined functions
@ 2010-06-29 12:58 jakub at gcc dot gnu dot org
  2010-06-29 13:25 ` [Bug debug/44712] " hubicka at ucw dot cz
  2010-07-01 18:56 ` roland at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-06-29 12:58 UTC (permalink / raw)
  To: gcc-bugs

/* { dg-options "-g -O2" } */
extern void abort (void);
extern void exit (int);
extern int printf (const char *, ...);

static int
foo (int x)
{
  typedef int T;
  T z = 2 * x;
  if (x <= 0)
    {
      printf ("foo\n");
      printf ("foo\n");
      printf ("foo\n");
      exit (0);
    }
  return 6;
}

__attribute__((noinline))
int bar (int x)
{
  return foo (x) + foo (6) + foo (x);
}

int
main (void)
{
  int l;
  asm volatile ("" : "=r" (l) : "0" (5));
  if (bar (l) != 18)
    abort ();
  bar (l - 10);
  abort ();
}

Debugging experience on this testcase isn't ideal, work will be needed both on
the gcc side and gdb side.  Roland has some ideas what should be done,
certainly DW_AT_artificial should be set on the foo.part* function, and perhaps
it should have some DW_TAG_lexical_block from the abstract DW_TAG_subprogram as
DW_AT_abstract_origin instead of the whole DW_TAG_subroutine (or perhaps some
artificial DW_TAG_lexical_block created just for that purpose?).
I'll let Roland write the details here himself.


-- 
           Summary: Debug info for partially inlined functions
           Product: gcc
           Version: 4.6.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


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


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

end of thread, other threads:[~2024-03-16 19:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-44712-4@http.gcc.gnu.org/bugzilla/>
2024-03-16 19:15 ` [Bug debug/44712] Debug info for partially inlined functions pinskia at gcc dot gnu.org
2010-06-29 12:58 [Bug debug/44712] New: " jakub at gcc dot gnu dot org
2010-06-29 13:25 ` [Bug debug/44712] " hubicka at ucw dot cz
2010-07-01 18:56 ` roland at redhat dot com

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).