Bug 14763 - [3.3 Regression] internal compiler error: in find_function_data, at function.c:320
Summary: [3.3 Regression] internal compiler error: in find_function_data, at func...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3.3
: P2 normal
Target Milestone: 3.3.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 14877 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-28 22:07 UTC by Jacek Sieka
Modified: 2004-10-30 21:10 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.2.3 3.4.0 4.0.0
Known to fail: 3.3.1
Last reconfirmed: 2004-03-28 23:35:12


Attachments
.ii file for bug (108.60 KB, application/octet-stream)
2004-03-28 22:08 UTC, Jacek Sieka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek Sieka 2004-03-28 22:07:15 UTC
Search for find_function_data yields no result so here we go...

The .ii file can be found at http://dcplusplus.sf.net/bug/QueueManager.ii.bz2

[1:arnetheduck:~/dcpp/gcc/client]$ g++ -v --save-temps -Wshadow -W  -march=i586 
-pipe -Wall -fPIC -DREENTRANT  -g -D_DEBUG    -c -o QueueManager.o ../..
/client/QueueManager.cpp 
g++: warning: -pipe ignored because -save-temps specified
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,
objc,ada,treelang --prefix=/usr --mandir=/usr/share/man 
--infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 
--enable-shared --with-system-zlib --enable-nls --without-included-gettext 
--enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm 
--enable-java-awt=xlib,gtk --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.3 (Debian 20040321)
 /usr/lib/gcc-lib/i486-linux/3.3.3/cc1plus -E -D__GNUG__=3 -quiet -v 
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D_GNU_SOURCE 
-DREENTRANT -D_DEBUG ../../client/QueueManager.cpp -march=i586 -Wshadow -W -Wall 
-fPIC QueueManager.ii
ignoring nonexistent directory "/usr/i486-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/arnetheduck/docs/VCProjects/Include/stlport
 /usr/include/c++/3.3
 /usr/include/c++/3.3/i486-linux
 /usr/include/c++/3.3/backward
 /usr/local/include
 /usr/lib/gcc-lib/i486-linux/3.3.3/include
 /usr/include
End of search list.
In file included from ../../client/TimerManager.h:26,
                 from ../../client/QueueManager.h:26,
                 from ../../client/QueueManager.cpp:28:
../../client/Thread.h:100:2: warning: #warning FIXME
../../client/Thread.h:111:2: warning: #warning FIXME
 /usr/lib/gcc-lib/i486-linux/3.3.3/cc1plus -fpreprocessed QueueManager.ii -quiet 
-dumpbase QueueManager.cpp -march=i586 -auxbase-strip QueueManager.o -g -Wshadow 
-W -Wall -version -fPIC -o QueueManager.s
GNU C++ version 3.3.3 (Debian 20040321) (i486-linux)
        compiled by GNU C version 3.3.3 (Debian 20040321).
GGC heuristics: --param ggc-min-expand=40 --param ggc-min-heapsize=19935
../../client/QueueManager.cpp: In member function `void 
   QueueManager::move(const _STL::string&, const _STL::string&)':
../../client/QueueManager.cpp:646: warning: declaration of `removeSource' 
   shadows a member of `this'
../../client/QueueManager.cpp: In member function `void 
   QueueManager::saveQueue()':
../../client/QueueManager.cpp:981: internal compiler error: in 
   find_function_data, at function.c:320
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Jacek Sieka 2004-03-28 22:08:38 UTC
Created attachment 6008 [details]
.ii file for bug
Comment 2 Andrew Pinski 2004-03-28 23:01:24 UTC
I can reproduce it and I am in the middle of reducing this case.
Comment 3 Andrew Pinski 2004-03-28 23:35:10 UTC
Confirmed here is a semi reduced testcase:
typedef unsigned int size_t;
class Exception
{
public: 
        Exception() { };
};
class SettingsManager
{
public: 
        enum IntSetting { INT_FIRST,
                BUFFER_SIZE,
                INT_LAST };
        int get(IntSetting key, bool useDefault = true) const {
        }
        static SettingsManager *getInstance();
private:
};
class File {
public: 
        enum {  
                CREATE = 0x02,
                TRUNCATE = 0x04
        };
        enum {  
                WRITE = 0x02,
        };
        File(const char* aFileName, int access, int mode) throw() {
        }
private:
        File(const File&);
        File& operator=(const File&);
};
template<bool managed>
class BufferedOutputStream {
public: 
        BufferedOutputStream(File* aStream, size_t aBufSize = (SettingsManager::getInstance()-
>get(SettingsManager::BUFFER_SIZE, true)) * 1024) : s(aStream), pos(0), bufSize(aBufSize){}
private:
        File * s;
        size_t pos;
        size_t bufSize;
};
class QueueManager
{
        void saveQueue() throw();
};
void QueueManager::saveQueue() throw() {
                File ff(".tmp", File::WRITE, File::CREATE | File::TRUNCATE);
                BufferedOutputStream<false> f(&ff);
}
Comment 4 Wolfgang Bangerth 2004-03-29 05:15:08 UTC
This is significantly shorter: 
----------------- 
struct A { 
    int get() const {} 
    static A *foo(); 
}; 
 
template<bool> struct S { 
    S(unsigned int = A::foo()->get())  ; 
}; 
 
void foo() throw() { 
  S<false> f; 
} 
--------------------------- 
g/x> /home/bangerth/bin/gcc-3.3.4-pre/bin/c++ -c x.cc 
x.cc: In function `void foo()': 
x.cc:11: internal compiler error: in find_function_data, at function.c:313 
Please submit a full bug report, 
 
W. 
Comment 5 Mark Mitchell 2004-03-30 22:00:46 UTC
Working on a fix.
Comment 7 GCC Commits 2004-03-30 23:45:06 UTC
Subject: Bug 14763

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-03-30 23:45:00

Modified files:
	gcc/cp         : ChangeLog decl.c pt.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/init: goto1.C 
	gcc/testsuite/g++.dg/template: defarg4.C 

Log message:
	PR c++/14724
	* decl.c (start_decl_1): Do not decide whether or not to create a
	new cleanup level until after the type has been completed.
	
	PR c++/14763
	* pt.c (tsubst_default_argument): Clear current_function_decl.
	
	PR c++/14724
	* g++.dg/init/goto1.C: New test.
	
	PR c++/14763
	* g++.dg/template/defarg4.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4018&r2=1.4019
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1198&r2=1.1199
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.844&r2=1.845
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3646&r2=1.3647
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/goto1.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/defarg4.C.diff?cvsroot=gcc&r1=1.1&r2=1.2

Comment 8 Mark Mitchell 2004-03-30 23:52:33 UTC
Fixed in GCC 3.4 and GCC 3.5.
Comment 9 Andrew Pinski 2004-04-07 13:51:17 UTC
*** Bug 14877 has been marked as a duplicate of this bug. ***
Comment 10 GCC Commits 2004-04-13 20:42:00 UTC
Subject: Bug 14763

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-rhl-branch
Changes by:	jakub@gcc.gnu.org	2004-04-13 20:41:57

Modified files:
	gcc/cp         : ChangeLog decl.c decl2.c pt.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/init: goto1.C 
	gcc/testsuite/g++.dg/template: defarg4.C 

Log message:
	2004-04-07  Jakub Jelinek  <jakub@redhat.com>
	
	* decl2.c (mark_used): Don't segfault if cfun != NULL but
	current_function_decl == NULL.
	
	2004-03-30  Mark Mitchell  <mark@codesourcery.com>
	
	PR c++/14724
	* decl.c (start_decl_1): Do not decide whether or not to create a
	new cleanup level until after the type has been completed.
	
	PR c++/14763
	* pt.c (tsubst_default_argument): Clear current_function_decl.
	
	PR c++/14724
	* g++.dg/init/goto1.C: New test.
	
	PR c++/14763
	* g++.dg/template/defarg4.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.3076.2.132.2.29&r2=1.3076.2.132.2.30
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.965.2.42.2.18&r2=1.965.2.42.2.19
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.575.2.28.2.6&r2=1.575.2.28.2.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.635.2.22.2.14&r2=1.635.2.22.2.15
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=1.2261.2.170.2.57&r2=1.2261.2.170.2.58
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/goto1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=NONE&r2=1.2.10.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/defarg4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-rhl-branch&r1=NONE&r2=1.2.10.1

Comment 11 GCC Commits 2004-05-01 20:27:43 UTC
Subject: Bug 14763

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	gdr@gcc.gnu.org	2004-05-01 20:27:40

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

Log message:
	Backport from gcc-3_4-branch
	2004-03-30  Mark Mitchell  <mark@codesourcery.com>
	Jakub Jelinek  <jakub@redhat.com>
	PR c++/14763
	* pt.c (tsubst_default_argument): Clear
	current_function_decl.
	* decl2.c (mark_used): Don't segfault if cfun != NULL but
	current_function_decl == NULL.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.266&r2=1.3076.2.267
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.575.2.36&r2=1.575.2.37
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.635.2.44&r2=1.635.2.45
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/defarg4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.2.20.1

Comment 12 Gabriel Dos Reis 2004-05-01 20:31:28 UTC
Fixed in 3.3.4 too.