Bug 9798 - [3.3 regression] Infinite recursion (segfault) in cp/decl.c:push_using_directive with recusive using directives
Summary: [3.3 regression] Infinite recursion (segfault) in cp/decl.c:push_using_direct...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P3 normal
Target Milestone: 3.4.0
Assignee: Jason Merrill
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-02-22 02:36 UTC by michael
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Logger.ii (63.33 KB, text/x-c++)
2003-05-21 15:17 UTC, michael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description michael 2003-02-22 02:36:00 UTC

Release:
gcc-3.2.2, 3.3, 3.4

How-To-Repeat:
 g++ -fmessage-length=0 -g -Werror -Wall -Wconversion -W -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wsign-compare -fPIC -c -o derived/x86-stlport/util/src/Logger.o Logger.ii
Comment 1 Christian Ehrhardt 2003-02-23 16:17:14 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed with 3.2.2, 3.3 and 3.4 trees. A reduced testcase is this:
    
    namespace std { }
    namespace STL { using namespace std; }
    namespace std {
      using namespace STL;
    }
    namespace STL {
      struct A {
        void B() { using namespace std; }
      };
    }
    
    The cc1plus binary either crashes with a segfault due to an infinite
    recursion in push_using_directive. This is a regression from 2.95.
    
       regards   Christian
Comment 2 Jason Merrill 2003-03-10 21:34:54 UTC
Responsible-Changed-From-To: unassigned->jason
Responsible-Changed-Why: got it
Comment 3 Jason Merrill 2003-03-10 22:03:52 UTC
From: jason@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9798
Date: 10 Mar 2003 22:03:52 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	jason@gcc.gnu.org	2003-03-10 22:03:52
 
 Added files:
 	gcc/testsuite/g++.dg/lookup: using3.C 
 
 Log message:
 	PR c++/9798
 	* decl.c (push_using_directive): Push before recursing.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/using3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 

Comment 4 Jason Merrill 2003-03-10 22:04:09 UTC
From: jason@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9798
Date: 10 Mar 2003 22:04:09 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	jason@gcc.gnu.org	2003-03-10 22:04:09
 
 Modified files:
 	gcc/cp         : ChangeLog decl.c 
 
 Log message:
 	PR c++/9798
 	* decl.c (push_using_directive): Push before recursing.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3256&r2=1.3257
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1017&r2=1.1018
 

Comment 5 Jason Merrill 2003-03-10 22:04:51 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: fixed.
Comment 6 Jason Merrill 2003-03-10 22:11:09 UTC
From: jason@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9798
Date: 10 Mar 2003 22:11:09 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_2-branch
 Changes by:	jason@gcc.gnu.org	2003-03-10 22:11:09
 
 Modified files:
 	gcc/cp         : ChangeLog decl.c 
 
 Log message:
 	PR c++/9798
 	* decl.c (push_using_directive): Push before recursing.
 
 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.67&r2=1.2685.2.114.2.68
 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.16&r2=1.866.2.36.2.17
 
Comment 7 Volker Reichelt 2003-03-18 14:26:14 UTC
State-Changed-From-To: closed->open
State-Changed-Why: The problem still persists on the 3.3 branch.
    
    Jason, your patches weren't applied to the 3.3 branch.
    Is this intentional or just an accident?
    In the latter case, could you please apply them?
    
    Thanks,
    Volker
Comment 8 Jason Merrill 2003-03-18 15:57:10 UTC
From: jason@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/9798
Date: 18 Mar 2003 15:57:10 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	jason@gcc.gnu.org	2003-03-18 15:57:10
 
 Modified files:
 	gcc/cp         : ChangeLog decl.c 
 
 Log message:
 	PR c++/9798
 	* decl.c (push_using_directive): Push before recursing.
 
 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.90&r2=1.3076.2.91
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.965.2.34&r2=1.965.2.35
Comment 9 Jason Merrill 2003-03-18 15:59:18 UTC
State-Changed-From-To: open->closed
State-Changed-Why: How odd.  Applied to 3.3.