public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/65797] New: [5.0 regression] IPA ICF causes function to be emitted with no debug line info
@ 2015-04-17 20:43 ian at airs dot com
  2015-04-17 21:29 ` [Bug tree-optimization/65797] " ian at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: ian at airs dot com @ 2015-04-17 20:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65797

            Bug ID: 65797
           Summary: [5.0 regression] IPA ICF causes function to be emitted
                    with no debug line info
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: hubicka at ucw dot cz
          Reporter: ian at airs dot com

This stand alone test case is boiled down from libgo/runtime/go-make-slice.c.


typedef unsigned int uintptr_t __attribute__ ((mode (pointer)));
typedef unsigned int uint64_t __attribute__ ((mode (DI)));

extern int f1 (char *, uintptr_t, uintptr_t);

int
f2 (char *p, uintptr_t s)
{
  return f1 (p, s, s);
}

int
f4 (char *p, uint64_t s1, uint64_t s2)
{
  uintptr_t t1, t2;

  t1 = (uintptr_t) s1;
  if ((uint64_t) t1 != s1)
    return 0;

  t2 = (uintptr_t) s2;
  if ((uint64_t) t2 != s2)
    return 0;

  return f1 (p, t1, t2);
}

int
f3 (char *p, uint64_t s)
{
  return f4 (p, s, s);
}


When I compile this -g -O2 -fno-optimize-sibling-calls on x86_64 f2 is
converted into a function that does nothing but call f3.  From the standpoint
of execution that is fine.  What is not fine is that f2 is emitted with no
debug line information.  When compiling for x86_64, the .s output is:

        .p2align 4,,15
        .globl  f2
        .type   f2, @function
f2:
.LFB4:
        .cfi_startproc
        subq    $8, %rsp
        .cfi_def_cfa_offset 16
        call    f3
        addq    $8, %rsp
        .cfi_def_cfa_offset 8
        ret
        .cfi_endproc
.LFE4:
        .size   f2, .-f2

Note the absence of any .loc directives.

This is causing a failure in the libgo testsuite (runtime/pprof on x86_64). 
The failure is, essentially, a failure of the stack backtrace to determine the
name of the function f2.  In the absence of line information the library is
unable to know the name of the function.


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

end of thread, other threads:[~2023-07-07 10:30 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-17 20:43 [Bug tree-optimization/65797] New: [5.0 regression] IPA ICF causes function to be emitted with no debug line info ian at airs dot com
2015-04-17 21:29 ` [Bug tree-optimization/65797] " ian at gcc dot gnu.org
2015-04-17 21:29 ` ian at gcc dot gnu.org
2015-04-17 22:39 ` hubicka at ucw dot cz
2015-04-17 23:00 ` [Bug tree-optimization/65797] [5 " ian at airs dot com
2015-04-17 23:09 ` hubicka at ucw dot cz
2015-04-17 23:12 ` hubicka at ucw dot cz
2015-04-17 23:15 ` ian at airs dot com
2015-04-18  2:48 ` hubicka at ucw dot cz
2015-04-20  8:26 ` rguenth at gcc dot gnu.org
2015-06-30 10:22 ` [Bug ipa/65797] [5/6 " rguenth at gcc dot gnu.org
2015-07-16  9:11 ` rguenth at gcc dot gnu.org
2021-05-14  9:47 ` [Bug ipa/65797] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:06 ` rguenth at gcc dot gnu.org
2022-05-27  9:35 ` [Bug ipa/65797] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:31 ` jakub at gcc dot gnu.org
2023-07-07 10:30 ` [Bug ipa/65797] [11/12/13/14 " rguenth 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).