public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* middle-end/4431: Wrong .stabs entries when using -O2
@ 2001-09-30 21:16 carlo
  0 siblings, 0 replies; only message in thread
From: carlo @ 2001-09-30 21:16 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4431
>Category:       middle-end
>Synopsis:       Wrong .stabs entries when using -O2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 30 21:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Carlo Wood
>Release:        All versions
>Organization:
>Environment:
i686-unknown-linux
>Description:
> /usr/local/gcc-3.1/lib/gcc-lib/i686-pc-linux-gnu/3.1/cc1plus -fpreprocessed bug.ii -quiet -dumpbase stabs.cc -g -O2 -Wall -Woverloaded-virtual -Wundef -Wpointer-arith -Wwrite-strings -Werror -Winline -version -o stabs.s
GNU CPP version 3.1 20010930 (experimental) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.1 20010930 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 3.1 20010930 (experimental).

Results in a stabs.s containing:

        .stabs  "../include/libcw/debugmalloc.h",132,0,0,.Ltext2
.Ltext2:
        .stabn 68,0,235,.LM2-main
.LM2:
        movl    $4, (%esp)
        call    _Znwj

Causing debuggers to think that 'new' was called from
debugmalloc.h line 235.

This is obviously not the case (see attached bug.ii file).
This problem does not occur with -O0 or -O1.

bug.ii file:

# 234 "../include/libcw/debugmalloc.h"
template<typename TYPE>
inline TYPE* __libcwd_allocCatcher(TYPE* new_ptr) {
  return new_ptr;
};
 
# 3 "stabs.cc"
 
int main(void)
{
  __libcwd_allocCatcher(new int);
  return 0;
}
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-09-30 21:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-30 21:16 middle-end/4431: Wrong .stabs entries when using -O2 carlo

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