[fixed in 4.5] "ICE: Segmentation fault" with precompiled header
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-4.4 (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
Binary package hint: gcc-4.4
Output of lsb_release -rd
Description: Ubuntu 9.10 Release: 9.10
Output of apt-cache policy g++:
g++:
Installed: 4:4.4.1-1ubuntu2
Candidate: 4:4.4.1-1ubuntu2
Version table:
*** 4:4.4.1-1ubuntu2 0
500 http://
100 /var/lib/
Problem description:
When I try to compile my c++ code with g++, an "internal compiler error: Segmentation fault" occurs and g++ stops work.
The problem can be reproduced with a simple case with three c++ files, foo.cc foo.h and all.h. The content of these files are as follows:
all.h
#ifndef STDIO_H_
#define STDIO_H_
#include <stdio.h>
#endif /* STDIO_H_ */
foo.h
#include "all.h"
foo.cc
#include "foo.h"
Steps to produce the problem
1) g++ all.h to generate all.h.gch
2) g++ -c foo.cc Then the following error occurs:
c1plus: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:/
If I remove all.h.gch and try step 2) again, everything goes fine.
If I change foo.h to the following content, then no error occurs.
foo.h
#include <math.h>
#include "all.h"
In addition, when I change foo.cc to foo.c and use gcc to repeat step 1) and 2), no error occurs.
description: | updated |
fixed in 4.5 (available as gcc-snapshot in lucid)