Bug 21004

Summary: internal error with -O
Product: [Retired] Red Hat Linux Reporter: Dimitri Papadopoulos <dimitri.papadopoulos>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-11-17 10:56:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
C++ source file to reproduce the bug. Compile with -O1 or better. none

Description Dimitri Papadopoulos 2000-11-17 10:54:55 UTC
Hi,

Compile this program with -O1 or better. You'll get a compiler internal
error.


#include <set>

class BugGCC {
public:
  // if the constructor is defined outside of the class declaration:
  //    g++: Internal error: Segmentation fault (cc1plus)
  BugGCC( const set<int>& aset = set<int>() );
  // if the constructor is defined inline:
  //    no error
  // BugGCC( const set<int>& aset = set<int>() ) : myset( aset ) { }

private:
  set<int> myset;
};

// if the constructor is defined outside of the class declaration:
//    g++: Internal error: Segmentation fault (cc1plus)
BugGCC::BugGCC( const set<int>& aset ) : myset( aset ) { }

int main() {
  BugGCC abug;
}

Comment 1 Dimitri Papadopoulos 2000-11-17 10:56:38 UTC
Created attachment 5483 [details]
C++ source file to reproduce the bug. Compile with -O1 or better.

Comment 2 Jakub Jelinek 2000-11-17 11:03:44 UTC
Fixed in gcc-c++-2.96-61 and above (in rawhide is ATM I think -63).