Bug 37383 - optimization - compiler crash
Summary: optimization - compiler crash
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-05 13:47 UTC by Dino Korah
Modified: 2008-12-24 23:11 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build: i486-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
the temporary file /tmp/ccZFb4sl.out (96.67 KB, text/plain)
2008-09-05 13:49 UTC, Dino Korah
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dino Korah 2008-09-05 13:47:40 UTC
Compiler crashed with these lines

g++ main.cpp expenditure_category.h expenditure_category.cpp -O4
expenditure_category.h: In member function ‘bool expenditure::category_compare::operator()(const expenditure::category&, const expenditure::category&) const’:
expenditure_category.h:33: error: ‘parent1’ was not declared in this scope
expenditure_category.h: In member function ‘bool expenditure::category_compare::operator()(const expenditure::category&, const expenditure::category&) const’:
expenditure_category.h:33: error: ‘parent1’ was not declared in this scope
expenditure_category.cpp:28: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.
Preprocessed source stored into /tmp/ccZFb4sl.out file, please attach this to your bugreport.
Comment 1 Dino Korah 2008-09-05 13:49:34 UTC
Created attachment 16232 [details]
the temporary file /tmp/ccZFb4sl.out
Comment 2 Dino Korah 2008-09-05 13:50:26 UTC
Here is the output without the optimization options

g++ main.cpp expenditure_category.h expenditure_category.cpp
expenditure_category.h: In member function ‘bool expenditure::category_compare::operator()(const expenditure::category&, const expenditure::category&) const’:
expenditure_category.h:33: error: ‘parent1’ was not declared in this scope
expenditure_category.h: In member function ‘bool expenditure::category_compare::operator()(const expenditure::category&, const expenditure::category&) const’:
expenditure_category.h:33: error: ‘parent1’ was not declared in this scope
Comment 3 Paolo Carlini 2008-09-05 14:00:48 UTC
Target? x86_64-linux?

I can't reproduce the problem on FSF 4.1.3, neither with 4.2.5, 4.3.2 or mainline. I suspect it's a Debian modification at fault, not to be reported here...

PS: -OX, with X >= 3 are all the same.
Comment 4 Paolo Carlini 2008-09-05 14:02:17 UTC
Figured out from the attachment...
Comment 5 Matthias Klose 2008-09-06 00:32:13 UTC
can't reproduce this either with the Debian or Ubuntu gcc builds
Comment 6 Andrew Pinski 2008-12-24 23:11:13 UTC
No feedback in 3 months and it works for me so closing as such.