This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
middle-end/4431: Wrong .stabs entries when using -O2
- To: gcc-gnats at gcc dot gnu dot org
- Subject: middle-end/4431: Wrong .stabs entries when using -O2
- From: carlo at alinoe dot com
- Date: 1 Oct 2001 04:10:15 -0000
- Reply-To: carlo at alinoe dot com
>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: