Bug 142090 - If an array of structs in a base class is too large, derived class will not compile.
If an array of structs in a base class is too large, derived class will not c...
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-12-07 03:26 EST by andy
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-12-07 11:18:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
source code that generates the internal error (262 bytes, text/plain)
2004-12-07 03:28 EST, andy
no flags Details

  None (edit)
Description andy 2004-12-07 03:26:27 EST
Description of problem:

When a base class has an array of structs as a public member, and this
struct has an array of strings as a member, compiling a derived class
results in an internal error if the sizes of the arrays are too large.  

Version-Release number of selected component (if applicable):

% g++ --version
g++ (GCC) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
Copyright (C) 2003 Free Software Foundation, Inc.

How reproducible:
always.

Steps to Reproduce:
1. g++ test1.cpp
  
Actual results:
% g++ test1.cpp
g++: Internal error: Segmentation fault (program cc1plus)
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.

Expected results:

I'm not sure -- I may be violating something in the c++ spec, but I
didn't expect to get the internal error.

Additional info:

If you change the number of sections to 50, the code compiles fine. 
Also, if you change the size of the struct member array called
'variable' to 1000, the program compiles fine.  I did not try to
figure out the exact sizes for which the program starts to fail.

Also interesting is if you get rid of the derived class, you can make
the sizes even larger in the base class and it will compile fine.
Comment 1 andy 2004-12-07 03:28:00 EST
Created attachment 108024 [details]
source code that generates the internal error
Comment 2 Jakub Jelinek 2004-12-07 11:18:46 EST
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18462

Note You need to log in before you can comment on or make changes to this bug.