public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: nathan@gcc.gnu.org
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org
Subject: Re: c/1881
Date: Sun, 01 Apr 2001 00:00:00 -0000	[thread overview]
Message-ID: <20010206095601.30022.qmail@sourceware.cygnus.com> (raw)

The following reply was made to PR c/1881; it has been noted by GNATS.

From: nathan@gcc.gnu.org
To: cljanss@ca.sandia.gov, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: c/1881
Date: 6 Feb 2001 09:51:15 -0000

 Synopsis: gcc -M output has changed--breaks make's automatic prereqs
 
 State-Changed-From-To: open->analyzed
 State-Changed-By: nathan
 State-Changed-When: Tue Feb  6 01:51:15 2001
 State-Changed-Why:
     Sort of confirmed.
     1) the -M options should work as the manual has always suggested,
     however -- and now they do if you provide -o to set the name
     of the object file. However, if you leave it to the default
     (which in your case would make if dep.o), we appear to
     do the wrong thing.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=1881&database=gcc
>From schmid@snake.iap.physik.tu-darmstadt.de Sun Apr 01 00:00:00 2001
From: schmid@snake.iap.physik.tu-darmstadt.de
To: gcc-gnats@gcc.gnu.org
Subject: c++/2210: ice, abi bug, virtual functions, optimization off
Date: Sun, 01 Apr 2001 00:00:00 -0000
Message-id: <200103072014.VAA08667@snake.iap.physik.tu-darmstadt.de>
X-SW-Source: 2001-q1/msg02088.html
Content-length: 6465

>Number:         2210
>Category:       c++
>Synopsis:       ice, abi bug, virtual functions, optimization off
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 07 11:16:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Peter Schmid
>Release:        3.1 20010307 (experimental)
>Organization:
TU Darmstadt
>Environment:
System: Linux kiste 2.4.2 #34 Sun Feb 25 20:03:34 CET 2001 i686 unknown
Architecture: i686
SuSE 7.1 
Glibc 2.2
GNU ld version 2.10.91 (with BFD 2.10.91.0.4)
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --enable-shared --disable-nls --enable-threads=posix --enable-long-long
>Description:
The following legal source code tb.C causes an internal compiler error
in instantiate_template. This does not happen if at least one of the
virtual keywords is removed, the enum is replaced with a built-in type,
the function test1() is moved directly in front of the function
tests() or optimization is turned on. The code did not crash the
compiler when -fno-new-abi was active for previous compiler
snapshots. Maybe this is an abi bug? 

Gcc-2.95.2 compiles the code without a problem. 
Note: The functions void f(A<T> d) and void g(A<T> &d) are never
called, but are needed to provoke the compiler crash. Gcc-3.0 did also
crash when I tryed about two weeks ago.


>How-To-Repeat:
source file tb.C

void tests();

template<class T>
class A {
public:
  virtual ~A(){}; 
};

class B {
public:
  enum r {};
  virtual void e(r a){};
};

template<class T>
class C
  : public B, 
    private A<T> 
{
public:
  C(){};
};


int main()
{
  tests();
}
template<class T>
void f(C<T> d){}

template<class T>
void g(C<T> &d)
{
  f(d);
}

void test1()
{
  C<int> d;
  g(d);
}

template<class T>
void f(A<T> d){}

template<class T>
void g(A<T> &d)
{
  f(d);
}

void tests()
{
    test1();
}

Compiling tb.C without optimization fails

g++ -v -o tb tb.C -W -Wall -save-temps
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc/configure --enable-shared --disable-nls --enable-threads=posix --enable-long-long
gcc version 3.1 20010307 (experimental)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/cpp0 -lang-c++ -D_GNU_SOURCE -D__GNUG__=3 -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -v -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__STDC_HOSTED__=1 -W -Wall -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ tb.C tb.ii
GNU CPP version 3.1 20010307 (experimental) (cpplib) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++-v3
 /usr/local/include/g++-v3/i686-pc-linux-gnu
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/include
 /usr/local/i686-pc-linux-gnu/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/cc1plus -fpreprocessed tb.ii -quiet -dumpbase tb.C -W -Wall -version -o tb.s
GNU CPP version 3.1 20010307 (experimental) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.1 20010307 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 3.1 20010307 (experimental).
tb.C: In function `void g(C<T>&) [with T = int]':
tb.C:41:   instantiated from here
tb.C:35: Internal error #283.
tb.C:35: Internal compiler error in instantiate_template, at cp/pt.c:7605
Please submit a full bug report, with preprocessed source if appropriate.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.

Compiling tb.C with optimization "-O" or whatever works 
g++ -O -v -o tb tb.C -W -Wall -save-temps
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc/configure --enable-shared --disable-nls --enable-threads=posix --enable-long-long
gcc version 3.1 20010307 (experimental)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/cpp0 -lang-c++ -D_GNU_SOURCE -D__GNUG__=3 -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -v -D__GNUC__=3 -D__GNUC_MINOR__=1 -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__ tb.C tb.ii
GNU CPP version 3.1 20010307 (experimental) (cpplib) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++-v3
 /usr/local/include/g++-v3/i686-pc-linux-gnu
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/include
 /usr/local/i686-pc-linux-gnu/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/cc1plus -fpreprocessed tb.ii -quiet -dumpbase tb.C -O -W -Wall -version -o tb.s
GNU CPP version 3.1 20010307 (experimental) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.1 20010307 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 3.1 20010307 (experimental).
tb.C: In method `virtual void B::e(B::r)':
tb.C:12: warning: unused parameter `B::r a'
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/../../../../i686-pc-linux-gnu/bin/as -V -Qy -o tb.o tb.s
GNU assembler version 2.10.91 (i686-pc-linux-gnu) using BFD version 2.10.91.0.4
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o tb /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/crtbegin.o -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1 -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/../../../../i686-pc-linux-gnu/lib -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/../../.. tb.o -lstdc++ -lm -lgcc_s -lc -lgcc_s /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/crtend.o /usr/lib/crtn.o

Preprocessed source file tb.ii

# 1 "tb.C"
void tests();

template<class T>
class A {
public:
  virtual ~A(){};
};

class B {
public:
  enum r {};
  virtual void e(r a){};
};

template<class T>
class C
  : public B,
    private A<T>
{
public:
  C(){};
};


int main()
{
  tests();
}
template<class T>
void f(C<T> d){}

template<class T>
void g(C<T> &d)
{
  f(d);
}

void test1()
{
  C<int> d;
  g(d);
}

template<class T>
void f(A<T> d){}

template<class T>
void g(A<T> &d)
{
  f(d);
}

void tests()
{
    test1();
}


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


             reply	other threads:[~2001-04-01  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-01  0:00 nathan [this message]
2001-04-01  0:00 c/1881 neil
2001-04-01  0:00 c/1881 Curtis L. Janssen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010206095601.30022.qmail@sourceware.cygnus.com \
    --to=nathan@gcc.gnu.org \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).