make[1]: Entering directory `/cygdrive/e/Orb/orbitcpp-0.30.4/compiler' /bin/sh ./libtool --mode=compile c++ -DHAVE_DLFCN_H=1 -I. -I. -I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include -I/usr/local/include/orbit-1.0 -I/usr/local/include/libIDL-1.0 -I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include -g -O2 -save-temps -c language.cc c++ -DHAVE_DLFCN_H=1 -I. -I. -I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include -I/usr/local/include/orbit-1.0 -I/usr/local/include/libIDL-1.0 -I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include -g -O2 -save-temps -c language.cc -DDLL_EXPORT -DPIC -o language.lo In file included from language.cc:33: types.hh: In constructor `IDLEnum::IDLEnum(const std::string&, _IDL_tree_node*, IDLScope*)': types.hh:571: internal error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions. make[1]: *** [language.lo] Error 1 make[1]: Leaving directory `/cygdrive/e/Orb/orbitcpp-0.30.4/compiler' Release: gcc version 3.2 20020818 (prerelease) Environment: Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/specs Configured with: /netrel/src/gcc-3.2-1/configure --enable-languages=c,c++,f77,java --enable-libgcj --enable-threads=posix --with-system-zlib --enable-nls --without-included-gettext --enable-interpreter --disable-sjlj-exceptions --disable-version-specific-runtime-libs --enable-shared --build=i686-pc-linux --host=i686-pc-cygwin --target=i686-pc-cygwin --enable-haifa --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --includedir=/nonexistent/include --libexecdir=/usr/sbin Thread model: posix gcc version 3.2 20020818 (prerelease) How-To-Repeat: compiling of orbitcpp-0.30.4 (orbit 0.5.17 patch for cygwin) http://orbitcpp.sourceforge.net/ ./configure make
Fix: http://gcc.gnu.org/ml/gcc-patches/2002-10/msg01421.html
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed.
From: =?iso-8859-1?Q?Pop_S=E9bastian?= <pop@gauvain.u-strasbg.fr> To: Reichelt <reichelt@igpm.rwth-aachen.de> Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, y_fedor@ciam.ru, gcc-patches@gcc.gnu.org Subject: Re: c++/8067: g++ 3.2 internal error: Segmentation fault Date: Mon, 30 Sep 2002 19:28:44 +0200 On Mon, Sep 30, 2002 at 07:35:23PM +0200, Reichelt wrote: > Hi, > > the problem can be demonstated with just a single line of (legal) code: > > ------------------snip here--------------------- > void foo() { for ( __PRETTY_FUNCTION__ ; ; ) ; } > ------------------snip here--------------------- > Thanks for your simplified version of the bug report. The following trivial patch solves the ICE for PR#8067. Sebastian. Index: decl.c =================================================================== RCS file: /cvsroot/gcc/gcc/gcc/cp/decl.c,v retrieving revision 1.937 diff -d -c -p -r1.937 decl.c *** decl.c 29 Sep 2002 11:53:48 -0000 1.937 --- decl.c 30 Sep 2002 17:11:01 -0000 *************** maybe_inject_for_scope_var (decl) *** 8006,8022 **** Otherwise, we need to preserve the temp slot for decl to last into the outer binding level. */ ! tree outer_binding ! = TREE_CHAIN (IDENTIFIER_BINDING (DECL_NAME (decl))); ! ! if (outer_binding && BINDING_LEVEL (outer_binding) == outer ! && (TREE_CODE (BINDING_VALUE (outer_binding)) ! == VAR_DECL) ! && DECL_DEAD_FOR_LOCAL (BINDING_VALUE (outer_binding))) { ! BINDING_VALUE (outer_binding) ! = DECL_SHADOWED_FOR_VAR (BINDING_VALUE (outer_binding)); ! current_binding_level->is_for_scope = 0; } else if (DECL_IN_MEMORY_P (decl)) preserve_temp_slots (DECL_RTL (decl)); --- 8006,8026 ---- Otherwise, we need to preserve the temp slot for decl to last into the outer binding level. */ ! tree ib, outer_binding; ! ib = IDENTIFIER_BINDING (DECL_NAME (decl)); ! if (ib) { ! outer_binding = TREE_CHAIN (ibdn); ! ! if (outer_binding && BINDING_LEVEL (outer_binding) == outer ! && (TREE_CODE (BINDING_VALUE (outer_binding)) ! == VAR_DECL) ! && DECL_DEAD_FOR_LOCAL (BINDING_VALUE (outer_binding))) ! { ! BINDING_VALUE (outer_binding) ! = DECL_SHADOWED_FOR_VAR (BINDING_VALUE (outer_binding)); ! current_binding_level->is_for_scope = 0; ! } } else if (DECL_IN_MEMORY_P (decl)) preserve_temp_slots (DECL_RTL (decl));
From: Reichelt <reichelt@igpm.rwth-aachen.de> To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, y_fedor@ciam.ru Cc: Subject: Re: c++/8067: g++ 3.2 internal error: Segmentation fault Date: Mon, 30 Sep 2002 19:35:23 +0200 Hi, the problem can be demonstated with just a single line of (legal) code: ------------------snip here--------------------- void foo() { for ( __PRETTY_FUNCTION__ ; ; ) ; } ------------------snip here--------------------- The error (using gcc 3.1, 3.2 or the main trunk) is (checked on mips-sgi-irix6.5 and i686-pc-linux-gnu): PR8067.cc: In function `void foo()': PR8067.cc:1: internal error: Segmentation fault Please submit a full bug report, [etc.] Since the code compiles fine with gcc 3.0.x, this is a regression. Thus, the PR should be marked "high priority". Greetings, Volker Reichelt http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8067
From: =?iso-8859-1?Q?Pop_S=E9bastian?= <pop@gauvain.u-strasbg.fr> To: Reichelt <reichelt@igpm.rwth-aachen.de> Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, y_fedor@ciam.ru, gcc-patches@gcc.gnu.org Subject: Re: c++/8067: g++ 3.2 internal error: Segmentation fault Date: Mon, 30 Sep 2002 21:58:33 +0200 --J/dobhs11T7y2rNN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Bootstrapped on x86. (configured with --enable-languages=c,c++) Ok for closing c++/8067 ? Sebastian 2002-09-30 Sebastian Pop <s.pop@laposte.net> * decl.c (maybe_inject_for_scope_var): Handle the case when IDENTIFIER_BINDING is NULL. Index: decl.c =================================================================== RCS file: /cvsroot/gcc/gcc/gcc/cp/decl.c,v retrieving revision 1.937 diff -d -c -p -r1.937 decl.c *** decl.c 29 Sep 2002 11:53:48 -0000 1.937 --- decl.c 30 Sep 2002 18:03:41 -0000 *************** maybe_inject_for_scope_var (decl) *** 8006,8022 **** Otherwise, we need to preserve the temp slot for decl to last into the outer binding level. */ ! tree outer_binding ! = TREE_CHAIN (IDENTIFIER_BINDING (DECL_NAME (decl))); ! ! if (outer_binding && BINDING_LEVEL (outer_binding) == outer ! && (TREE_CODE (BINDING_VALUE (outer_binding)) ! == VAR_DECL) ! && DECL_DEAD_FOR_LOCAL (BINDING_VALUE (outer_binding))) { ! BINDING_VALUE (outer_binding) ! = DECL_SHADOWED_FOR_VAR (BINDING_VALUE (outer_binding)); ! current_binding_level->is_for_scope = 0; } else if (DECL_IN_MEMORY_P (decl)) preserve_temp_slots (DECL_RTL (decl)); --- 8006,8026 ---- Otherwise, we need to preserve the temp slot for decl to last into the outer binding level. */ ! tree ib, outer_binding; ! ib = IDENTIFIER_BINDING (DECL_NAME (decl)); ! if (ib) { ! outer_binding = TREE_CHAIN (ib); ! ! if (outer_binding && BINDING_LEVEL (outer_binding) == outer ! && (TREE_CODE (BINDING_VALUE (outer_binding)) ! == VAR_DECL) ! && DECL_DEAD_FOR_LOCAL (BINDING_VALUE (outer_binding))) ! { ! BINDING_VALUE (outer_binding) ! = DECL_SHADOWED_FOR_VAR (BINDING_VALUE (outer_binding)); ! current_binding_level->is_for_scope = 0; ! } } else if (DECL_IN_MEMORY_P (decl)) preserve_temp_slots (DECL_RTL (decl)); --J/dobhs11T7y2rNN Content-Type: text/x-c++src; charset=us-ascii Content-Disposition: attachment; filename="r1.cc" // { dg-do compile } // Copyright (C) 2002 Free Software Foundation, Inc. // Contributed by Sebastian Pop 30 Sep 2002 <s.pop@laposte.net> void foo() { for ( __PRETTY_FUNCTION__ ; ; ) ; } --J/dobhs11T7y2rNN--
From: Jason Merrill <jason@redhat.com> To: Pop =?iso-8859-1?q?S=E9bastian?= <pop@gauvain.u-strasbg.fr> Cc: Reichelt <reichelt@igpm.rwth-aachen.de>, gcc-gnats@gcc.gnu.org, y_fedor@ciam.ru, gcc-patches@gcc.gnu.org Subject: Re: c++/8067: g++ 3.2 internal error: Segmentation fault Date: Tue, 01 Oct 2002 10:44:24 +0100 Thanks, but your patch is just a workaround; the problem is that we think we're dealing with a variable declared in the for-init-stmt, but we really aren't. Either we need to add more tests to the enclosing if, or we need to change current_binding_level when pushing __PRETTY_FUNCTION__. Jason
From: =?iso-8859-1?Q?Pop_S=E9bastian?= <pop@gauvain.u-strasbg.fr> To: Jason Merrill <jason@redhat.com> Cc: Reichelt <reichelt@igpm.rwth-aachen.de>, gcc-gnats@gcc.gnu.org, y_fedor@ciam.ru, gcc-patches@gcc.gnu.org Subject: Re: c++/8067: g++ 3.2 internal error: Segmentation fault Date: Sun, 6 Oct 2002 20:59:50 +0200 Hi Jason, On Tue, Oct 01, 2002 at 10:44:24AM +0100, Jason Merrill wrote: > Thanks, but your patch is just a workaround; the problem is that we think > we're dealing with a variable declared in the for-init-stmt, but we really > aren't. Ok, so we have to teach G++ that __PRETTY_FUNCTION__ is not a local declaration in the FOR_INIT. > Either we need to add more tests to the enclosing if, or we need > to change current_binding_level when pushing __PRETTY_FUNCTION__. > What about the following patch for solving the PR following the first suggestion? Index: decl.c =================================================================== RCS file: /cvsroot/gcc/gcc/gcc/cp/decl.c,v retrieving revision 1.942 diff -d -u -p -r1.942 decl.c --- decl.c 2 Oct 2002 18:46:40 -0000 1.942 +++ decl.c 6 Oct 2002 18:48:16 -0000 @@ -8305,7 +8305,8 @@ cp_finish_decl (decl, init, asmspec_tree if (init) DECL_INITIAL (decl) = init; } - else if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL) + else if (TREE_CODE (CP_DECL_CONTEXT (decl)) == FUNCTION_DECL + && !DECL_PRETTY_FUNCTION_P (decl)) { /* This is a local declaration. */ if (doing_semantic_analysis_p ())
From: Gabriel Dos Reis <gdr@integrable-solutions.net> To: Pop Sébastian <pop@gauvain.u-strasbg.fr> Cc: Jason Merrill <jason@redhat.com>, Reichelt <reichelt@igpm.rwth-aachen.de>, gcc-gnats@gcc.gnu.org, y_fedor@ciam.ru, gcc-patches@gcc.gnu.org Subject: Re: c++/8067: g++ 3.2 internal error: Segmentation fault Date: 06 Oct 2002 21:10:01 +0200 Pop Sébastian <pop@gauvain.u-strasbg.fr> writes: | Hi Jason, | | On Tue, Oct 01, 2002 at 10:44:24AM +0100, Jason Merrill wrote: | > Thanks, but your patch is just a workaround; the problem is that we think | > we're dealing with a variable declared in the for-init-stmt, but we really | > aren't. | Ok, so we have to teach G++ that __PRETTY_FUNCTION__ is not a local declaration | in the FOR_INIT. More specifically, we have to teach the front-end about gracious handling of similar erroneous constructs in the for-init-statement. | What about the following patch for solving the PR following the first suggestion? Does it handle similar constructs where you replace __PRETTY_FUNCTION__ with another id-expression? I'm under the impression that it does not. -- Gaby
From: =?iso-8859-1?Q?Pop_S=E9bastian?= <pop@gauvain.u-strasbg.fr> To: Gabriel Dos Reis <gdr@integrable-solutions.net> Cc: Jason Merrill <jason@redhat.com>, Reichelt <reichelt@igpm.rwth-aachen.de>, gcc-gnats@gcc.gnu.org, y_fedor@ciam.ru, gcc-patches@gcc.gnu.org Subject: Re: c++/8067: g++ 3.2 internal error: Segmentation fault Date: Mon, 7 Oct 2002 23:14:02 +0200 > > | What about the following patch for solving the PR following the first suggestion? > > Does it handle similar constructs where you replace > __PRETTY_FUNCTION__ with another id-expression? I'm under the > impression that it does not. > I tested the patch with "make check-c++" and results are exactly the same as on the original version. === g++ Summary === # of expected passes 6979 # of unexpected failures 598 # of unexpected successes 1 # of expected failures 91 # of untested testcases 9 # of unsupported tests 3 /home/pop/gcc/main/bin/gcc/testsuite/../g++ version gcc 3.3 20021005 (experimental) === libstdc++-v3 Summary === # of expected passes 397 # of unexpected failures 16 # of unexpected successes 1 # of expected failures 26 Sebastian
Responsible-Changed-From-To: unassigned->mmitchel Responsible-Changed-Why: Working on a variant of Sebastian's patch; it is the right idea.
State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed in G++ 3.2.1.
From: mmitchel@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c++/8067 Date: 24 Oct 2002 00:01:37 -0000 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2002-10-23 17:01:37 Modified files: gcc/cp : ChangeLog decl.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/lookup: pretty1.C Log message: PR c++/8067 * decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and related variables. PR c++/8067 * g++.dg/lookup/pretty1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3023&r2=1.3024 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.952&r2=1.953 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2177&r2=1.2178 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/pretty1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
From: mmitchel@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c++/8067 Date: 24 Oct 2002 00:03:16 -0000 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_2-branch Changes by: mmitchel@gcc.gnu.org 2002-10-23 17:03:16 Modified files: gcc/cp : ChangeLog decl.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/lookup: pretty1.C Log message: PR c++/8067 * decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and related variables. PR c++/8067 * g++.dg/lookup/pretty1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.2685.2.114.2.31&r2=1.2685.2.114.2.32 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.866.2.36.2.7&r2=1.866.2.36.2.8 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1672.2.166.2.37&r2=1.1672.2.166.2.38 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/pretty1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1