public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/10401: [3.3/3.4 regression] Seg fault with "-pedantic -Wunreachable-code"
@ 2003-04-14 17:04 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-04-14 17:04 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, gdr, jason, nobody, olivier.leclant

Old Synopsis: internal error: Segmentation fault using std::vector with "-pedantic -Wunreachable-code"
New Synopsis: [3.3/3.4 regression] Seg fault with "-pedantic -Wunreachable-code"

Responsible-Changed-From-To: unassigned->jason
Responsible-Changed-By: bangerth
Responsible-Changed-When: Mon Apr 14 17:04:22 2003
Responsible-Changed-Why:
    Likely associated with a patch that led to this
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Mon Apr 14 17:04:22 2003
State-Changed-Why:
    [Gaby, I add you to the list of listeners to this report,
    since it may be a 3.2 branch regression for
    - C++ standard headers
    - a common combination of flags.]
    
    Confirmed. Here's a redux:
    -----------------
    template <typename T>
    struct X {
        X() throw() {}
    };
    template class X<int>;
    -------------------------
    g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -pedantic -Wunreachable-code -c y.cc
    y.cc: In constructor `X<T>::X() [with T = int]':
    y.cc:3:   instantiated from `X<T>::X() [with T = int]'
    y.cc:5:   instantiated from here
    y.cc:3: internal compiler error: Segmentation fault
    
    It fails with both 3.3 and mainline (3.4). I doesn't fail
    with the lates 3.2.3pre I have on my disk, which is
    2003-03-29, but according to the submitter it also fails
    on this branch. Since the code in question is in a standard
    header and the flags used are a rather usual combination,
    this is a quite severe combination.
    
    On mainline, here's a backtrace:
    #0  never_reached_warning (avoided_insn=0x40180c34, finish=0x40180c34)
        at ../../gcc-3.4-CVS/gcc/jump.c:1916
    #1  0x08189b7c in flow_delete_block_noexpunge (b=0x85d1ae0)
        at ../../gcc-3.4-CVS/gcc/cfgrtl.c:379
    #2  0x08189c57 in flow_delete_block (b=0x85d1ae0)
        at ../../gcc-3.4-CVS/gcc/cfgrtl.c:415
    #3  0x083d01eb in try_optimize_cfg (mode=16)
        at ../../gcc-3.4-CVS/gcc/cfgcleanup.c:1775
    #4  0x083d05bc in cleanup_cfg (mode=16)
        at ../../gcc-3.4-CVS/gcc/cfgcleanup.c:1930
    
    It fails in this code
      /* Back up to the first of any NOTEs preceding avoided_insn; flow passes
         us the head of a block, a NOTE_INSN_BASIC_BLOCK, which often follows
         the line note.  */
      for (insn = PREV_INSN (avoided_insn); ; insn = PREV_INSN (insn))
        if (GET_CODE (insn) != NOTE)
          {
    	insn = NEXT_INSN (insn);
    	break;
          }
    since insn==NULL, which doesn't play nice in the GET_CODE.
    This code was added by Jason in 1.221 here:
    revision 1.221
    date: 2003/04/04 01:21:56;  author: jason;  state: Exp;  lines: +12 -2
            PR c/10175
            * jump.c (never_reached_warning): Revert patch of 2002-11-02.
            Look backwards for a line note.
    
    This patch also appears on the 3.2 branch. Jason, can you
    take a look what happens here?
    
    W.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10401


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: c++/10401: [3.3/3.4 regression] Seg fault with "-pedantic -Wunreachable-code"
@ 2003-04-14 17:26 Giovanni Bajo
  0 siblings, 0 replies; 2+ messages in thread
From: Giovanni Bajo @ 2003-04-14 17:26 UTC (permalink / raw)
  To: jason; +Cc: gcc-prs

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

From: "Giovanni Bajo" <giovannibajo@libero.it>
To: "Gabriel Dos Reis" <gdr@integrable-solutions.net>,
	<gcc-gnats@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>,
	<jason@gcc.gnu.org>,
	<olivier.leclant@netcreek.com>
Cc:  
Subject: Re: c++/10401: [3.3/3.4 regression] Seg fault with "-pedantic -Wunreachable-code"
Date: Mon, 14 Apr 2003 19:21:42 +0200

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 r=10401
 
 I think it's even worse:
 
 ------------------------
 struct Foo
 {
     Foo() throw()
     {}
 };
 
 Foo f;
 ------------------------
 pr10401.cpp: In constructor `Foo::Foo()':
 pr10401.cpp:3: internal compiler error: Segmentation fault
 Please submit a full bug report,
 
 Confirmed on 3.3 and 3.4, I don't have 3.2.3pre.
 
 Giovanni Bajo
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-14 17:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-14 17:04 c++/10401: [3.3/3.4 regression] Seg fault with "-pedantic -Wunreachable-code" bangerth
2003-04-14 17:26 Giovanni Bajo

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).