First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 15165
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Mark Mitchell <mark@codesourcery.com>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Sergei Kozachenko <wishmaster@e-mail.ru>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
main.ii file produced by gcc with option -save-temps text/plain 2004-04-27 09:48 126.15 KB Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 15165 depends on: Show dependency tree
Show dependency graph
Bug 15165 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2004-04-27 13:08 Opened: 2004-04-27 09:44
crash while compiling

------- Comment #1 From Sergei Kozachenko 2004-04-27 09:48 -------
Created an attachment (id=6170) [edit]
file produced by gcc with option -save-temps

gcc building options was:
make CFLAGS='-O2 -march=pentium4 -mcpu=pentium4 -msse2 -funroll-all-loops
-mpreferred-stack-boundary=4 -mfpmath=sse -malign-double
-momit-leaf-frame-pointer -fomit-frame-pointer -fforce-mem -fforce-addr
-falign-functions -falign-labels -falign-loops -falign-jumps -frename-registers
-fno-cprop-registers -ffast-math' LIBCFLAGS='-g -O2'	    LIBCXXFLAGS='-g -O2
-fno-implicit-templates' bootstrap

------- Comment #2 From Andrew Pinski 2004-04-27 11:52 -------
Confirmed a regression but I have not reduced it yet.

------- Comment #3 From Wolfgang Bangerth 2004-04-27 13:07 -------
The testcase is here: 
----------------- 
struct S 
{ 
    template <class T> S(const T &e); 
}; 
 
int operator *(const double, const S &); 
 
template <class T> struct X { 
    enum { SIXTY_FOUR=64 }; 
 
    struct node { 
        unsigned char *ptr[sizeof(T)*SIXTY_FOUR]; 
        void add(const T &obj) {} 
    }; 
 
    node *head; 
}; 
 
void foo(int &c) { 
  X<int>().head->add(c); 
} 
------------------ 
 
g/x> /home/bangerth/bin/gcc-3.3.4-pre/bin/c++ -c x.cc 
 
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc 
x.cc: In instantiation of `X<int>::node': 
x.cc:20:   instantiated from here 
x.cc:12: internal compiler error: in instantiate_template, at cp/pt.c:8669 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc 
x.cc: In instantiation of `X<int>::node': 
x.cc:20:   instantiated from here 
x.cc:12: internal compiler error: in instantiate_template, at cp/pt.c:8671 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
W. 

------- Comment #4 From Andrew Pinski 2004-04-27 13:24 -------
Reduced a little further:
struct S 
{ 
    template <class T> S(const T &e);
};
int operator *(const double, const S &); 
template <class T>
struct X { 
    enum { SIXTY_FOUR=64 }; 
    struct node {
        unsigned char *ptr[sizeof(T)*SIXTY_FOUR]; // <-- catching operator* from above?
        void d() {}
    };
    node *head; 
};
template struct X<int>;

------- Comment #5 From CVS Commits 2004-05-23 22:45 -------
Subject: Bug 15165

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-05-23 22:45:13

Modified files:
	gcc/cp         : ChangeLog pt.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: crash19.C 

Log message:
	PR c++/15165
	* g++.dg/template/crash19.C: New test.
	
	PR c++/15165
	* g++.dg/template/crash19.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.104&r2=1.3892.2.105
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.25&r2=1.816.2.26
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.181&r2=1.3389.2.182
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash19.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1


------- Comment #6 From CVS Commits 2004-05-23 22:48 -------
Subject: Bug 15165

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-05-23 22:48:38

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/cp         : ChangeLog pt.c 
Added files:
	gcc/testsuite/g++.dg/template: crash19.C 

Log message:
	PR c++/15165
	* pt.c (instantiate_template): Robustify.
	
	PR c++/15165
	* g++.dg/template/crash19.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3775&r2=1.3776
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash19.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4055&r2=1.4056
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.853&r2=1.854


------- Comment #7 From Mark Mitchell 2004-05-23 22:50 -------
Fixed in GCC 3.4.1.

------- Comment #8 From Mark Mitchell 2004-05-23 23:04 -------
*** Bug 15038 has been marked as a duplicate of this bug. ***

------- Comment #9 From Andrew Pinski 2004-06-18 15:54 -------
*** Bug 16062 has been marked as a duplicate of this bug. ***

First Last Prev Next    No search results available      Search page      Enter new bug