This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

middle-end/4431: Wrong .stabs entries when using -O2



>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]