Bug 205919 - ICE related to std::vector<std::vector<...> > >
ICE related to std::vector<std::vector<...> > >
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc (Show other bugs)
4.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-10 01:30 EDT by Hui Li
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: RHSA-2007-0220
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-01 13:08:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
This is the preprocessed output. (2.13 MB, text/text)
2006-09-10 01:36 EDT, Hui Li
no flags Details
Reduced testcase (262 bytes, text/x-c++src)
2006-10-26 02:21 EDT, Alexandre Oliva
no flags Details
Patch that fixes the bug (2.44 KB, patch)
2006-10-26 03:09 EDT, Alexandre Oliva
no flags Details | Diff
Safer patch that fixes the bug (853 bytes, patch)
2006-10-27 02:36 EDT, Alexandre Oliva
no flags Details | Diff

  None (edit)
Description Hui Li 2006-09-10 01:30:49 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; zh-cn) AppleWebKit/418.8 (KHTML, like Gecko) Safari/419.3

Description of problem:
This bug seems to relate to accessing elements of a std::vector<std::vector<some_type> > > object using 
double subscripting [...][...].  However, when I tried with a simplified code, the falure didn't reproduce, so I 
guess vector of vector is just part of the reason of this bug.

Version-Release number of selected component (if applicable):
gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)

How reproducible:
Always


Steps to Reproduce:
1. Just compile the proprocessed code.

Actual Results:
internal compiler error: Segmentation fault

where accessing element of std::vector<std::vector<some_type> > > using [...][...] failed.

Expected Results:


Additional info:
I found a simple work-around, i.e. to separate the [...][..] into two steps. For example, let V be of the type 
std::vector<std::vector<some_type> > >, instead of writing V[i][j], writing

const std::vector<some_type>& w = V[i];
w[j];

solved the problem.
Comment 1 Hui Li 2006-09-10 01:36:56 EDT
Created attachment 135915 [details]
This is the preprocessed output.
Comment 2 Alexandre Oliva 2006-10-26 02:21:20 EDT
Created attachment 139437 [details]
Reduced testcase
Comment 3 Alexandre Oliva 2006-10-26 03:09:00 EDT
Created attachment 139441 [details]
Patch that fixes the bug

This backport fixes the ICE in both the reduced and the original testcases.  I
had to cherry-pick only a few portions of the original patch, and the most
important change (the removal of the obsolete new-type-id) isn't appropriate
for GCC 3.4 because it wasn't obsolete then.  I've tried to overcome the
problem with a simplification that I hope will work, but my testing isn't
complete yet and I'm not entirely familiar with the workings of this old
new-type-id construct.	I'd appreciate a second pair of g++-familiar eyeballs
on this change.
Comment 4 Alexandre Oliva 2006-10-27 02:36:12 EDT
Created attachment 139556 [details]
Safer patch that fixes the bug

This patch is much safer and fixes the problem just the same.
Comment 10 Red Hat Bugzilla 2007-05-01 13:08:11 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2007-0220.html

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