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]

c++/1757: ice: new-abi function-inlining friends



>Number:         1757
>Category:       c++
>Synopsis:       ice: new-abi function-inlining friends
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 24 07:56:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Peter Schmid
>Release:        2.97 20010123 (experimental)
>Organization:
TU Darmstadt
>Environment:
System: Linux kiste 2.4.0 #25 Tue Jan 16 01:22:25 CET 2001 i686 unknown
Architecture: i686
glibc 2.1.3
GNU assembler version 2.10.91 (i686-pc-linux-gnu) using BFD version 2.10.1.0.4
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --disable-nls --enable-shared
>Description:
Compiling the following, legal source code causes g++-20010123 to crash with
an internal error. This does not happen if -fno-new-abi is added to
the comand line, or if the friend function is removed or if
function-inlining is turned off.
>How-To-Repeat:
source file s.C

class A {
  friend A operator+(const A &a1, const A &a2);

public:
  A(const A &copy);
    A(int c)    {}
  A Copy();

private:
  int len;        
};

A operator+(const A &a1, const A &a2)
{
  A result(a1.len + a2.len);
  return result;
}

A::A(const A &copy)
{
  *this = copy;
}

A  A::Copy()
{
  A t(10);
  return t;
}


preprocessed source file
s.i
# 1 "s.C"
class A {


public:
  A(const A &copy);
    A(int c) {}
  A Copy();

private:
  int len;
};







A::A(const A &copy)
{
  *this = copy;
}

A A::Copy()
{
  A t(10);
  return t;
}

Compiling the source file
g++ -v -Q -c s.C -W -Wall -finline-functions -O
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: ../gcc/configure --disable-nls --enable-shared --enable-threads=posix
gcc version 2.97 20010123 (experimental)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/cc1plus -v -D__GNUC__=2 -D__GNUC_MINOR__=97 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -W -Wall -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ s.C -D__GNUG__=2 -D_GNU_SOURCE -D__GXX_ABI_VERSION=100 -dumpbase s.C -O -W -Wall -version -finline-functions -o /tmp/ccJ54WTz.s
GNU CPP version 2.97 20010123 (experimental) (cpplib) (i386 Linux/ELF)
GNU CPP version 2.97 20010123 (experimental) (cpplib) (i386 Linux/ELF)
GNU C++ version 2.97 20010123 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 2.97 20010123 (experimental).
options passed:  -v -D__GNUC__=2 -D__GNUC_MINOR__=97
 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__
 -D__linux__ -D__unix -D__linux -Asystem=posix -D__OPTIMIZE__
 -D__STDC_HOSTED__=1 -W -Wall -Acpu=i386 -Amachine=i386 -Di386 -D__i386
 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ -D__GNUG__=2
 -D_GNU_SOURCE -D__GXX_ABI_VERSION=100 -O -W -Wall -finline-functions
options enabled:  -fdefer-pop -fthread-jumps -fpeephole -ffunction-cse
 -finline-functions -finline -fkeep-static-consts -fpcc-struct-return
 -fsched-interblock -fsched-spec -fbranch-count-reg -fexceptions
 -fnew-exceptions -fcommon -fgnu-linker -fargument-alias -fident
 -fguess-branch-probability -fmath-errno -m80387 -mhard-float
 -mno-soft-float -mieee-fp -mfp-ret-in-387
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++-v3
 /usr/local/i686-pc-linux-gnu/include/g++-v3
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/include
 /usr/local/i686-pc-linux-gnu/include
 /usr/include
End of search list.
 A::A(int) A::A(int) A::A(int) A operator+(const A&, const A&) A operator+(const A&, const A&) A::A(const A&) A::A(const A&) A::A(const A&) A::A(const A&) A::A(const A&) A A::Copy() A A::Copy()
s.C:27: Internal error: Segmentation fault.
Please submit a full bug report.
 See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

without new-abi:

g++ -v -c s.C -W -Wall -finline-functions -O -fno-new-abi
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: ../gcc/configure --disable-nls --enable-shared --enable-threads=posix
gcc version 2.97 20010123 (experimental)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/cc1plus -v -D__GNUC__=2 -D__GNUC_MINOR__=97 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -W -Wall -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ s.C -D__GNUG__=2 -D_GNU_SOURCE -quiet -dumpbase s.C -O -W -Wall -version -finline-functions -fno-new-abi -o /tmp/ccmbUi3F.s
GNU CPP version 2.97 20010123 (experimental) (cpplib) (i386 Linux/ELF)
GNU CPP version 2.97 20010123 (experimental) (cpplib) (i386 Linux/ELF)
GNU C++ version 2.97 20010123 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 2.97 20010123 (experimental).
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++-v3
 /usr/local/i686-pc-linux-gnu/include/g++-v3
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/include
 /usr/local/i686-pc-linux-gnu/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/../../../../i686-pc-linux-gnu/bin/as -V -Qy -o s.o /tmp/ccmbUi3F.s
GNU assembler version 2.10.91 (i686-pc-linux-gnu) using BFD version 2.10.1.0.4

Compilation finished at Wed Jan 24 16:44:55


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