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]

gcc 2.95.3-1 optimizer bug


Hello!

It seems there is optimizer bug, when I compile quite simple code (b.cpp):

/*------------------------------------------------------*/
#include <string>

typedef string String;

main()
{
  String q,w;
}
/*------------------------------------------------------*/

with command:

c++ -O6 -fno-exceptions -fno-inline -v -S b.cpp

I receive the assembler file (b.s) with this:

...
 call ___t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b0i0
 addl $32,%esp
 addl $-8,%esp
...

Why I've got this double addl?

My system is:

Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-1/specs
gcc driver version 2.95.3-1 (cygwin special) executing gcc version gcc-2.95.3-1

/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-1/cpp0.exe -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D_X86_=1
 -D_X86_=1 -Asystem(winnt) -D__OPTIMIZE__ -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i6
86__ -D__pentiumpro -D__pentiumpro__ -D__stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__)) -D_stdcall=__attr
ibute__((__stdcall__)) -D_cdecl=__attribute__((__cdecl__)) -D__declspec(x)=__attribute__((x)) -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D_
_unix__ -D__unix -isystem /usr/local/include -idirafter /usr/include -idirafter /usr/include/w32api -isystem
/usr/include/g++-3 -isystem /usr/include/g++ b.cpp /cygdrive/d/WinNT/Temp/ccwSIyzZ.ii
GNU CPP version 2.95.3-1 (cygwin special) (80386, BSD syntax)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/include/g++-3
 /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-1/include
 /usr/include
 /usr/include/w32api
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
 /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-1/cc1plus.exe /cygdrive/d/WinNT/Temp/ccwSIyzZ.ii -quiet -dumpbase
b.cc -O4 -version -fno-exceptions -fno-inline -o b.s
GNU C++ version 2.95.3-1 (cygwin special) (i686-pc-cygwin) compiled by GNU C version gcc-2.95.3-1 (cygwin experimental).

                              Johny Mukhanov aka Cage



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