Bug 32885 - Internal compiler error when using -fopenmp -O3 -fno-unit-at-a-time option
Summary: Internal compiler error when using -fopenmp -O3 -fno-unit-at-a-time option
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.2.1
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2007-07-24 18:34 UTC by berkin ozisikyilmaz`
Modified: 2007-12-28 16:40 UTC (History)
2 users (show)

See Also:
Host: AMD Athlon 2.2ghz
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work: 4.3.0
Known to fail: 4.2.0 4.2.1 4.2.2
Last reconfirmed:


Attachments
The intermediate file for the problematic source file (11.43 KB, application/octet-stream)
2007-07-24 18:36 UTC, berkin ozisikyilmaz`
Details

Note You need to log in before you can comment on or make changes to this bug.
Description berkin ozisikyilmaz` 2007-07-24 18:34:45 UTC
Hi, 
I was trying to compile my Openmp parallel code, and see the effects of turning of f of some optimization parameters. I get an internal compiler error. The whole error is attached below. 

miner-02:/files4/berkin/kmeans % make OPTFLAGS="-O3 -fno-unit-at-a-time -v -save-temps"
/files4/berkin/gcc-4.2.1/bin/gcc -fopenmp -O3 -fno-unit-at-a-time -v -save-temps   -c fuzzy_kmeans.c
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/files4/berkin/gcc-4.2.1 --enable-threads
Thread model: posix
gcc version 4.2.1
 /files4/berkin/gcc-4.2.1/libexec/gcc/i686-pc-linux-gnu/4.2.1/cc1 -E -quiet -v -D_REENTRANT fuzzy_kmeans.c -mtune=generic -fopenmp -fno-unit-at-a-time -O3 -fpch-preprocess -o fuzzy_kmeans.i
ignoring nonexistent directory "/files4/berkin/gcc-4.2.1/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /files4/berkin/gcc-4.2.1/include
 /files4/berkin/gcc-4.2.1/lib/gcc/i686-pc-linux-gnu/4.2.1/include
 /usr/include
End of search list.
 /files4/berkin/gcc-4.2.1/libexec/gcc/i686-pc-linux-gnu/4.2.1/cc1 -fpreprocessed fuzzy_kmeans.i -quiet -dumpbase fuzzy_kmeans.c -mtune=generic -auxbase fuzzy_kmeans -O3 -version -fopenmp -fno-unit-at-a-time -o fuzzy_kmeans.s
GNU C version 4.2.1 (i686-pc-linux-gnu)
        compiled by GNU C version 4.2.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 80e6f10ad3e2beca945f13dba64821c7
fuzzy_kmeans.c: In function 'fuzzy_kmeans_cluster':
fuzzy_kmeans.c:111: 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.
make: *** [fuzzy_kmeans.o] Error 1
Comment 1 berkin ozisikyilmaz` 2007-07-24 18:36:53 UTC
Created attachment 13963 [details]
The intermediate file for the problematic source file
Comment 2 Andrew Pinski 2007-07-24 18:39:33 UTC
Is there a reason why you are using -fno-unit-at-a-time ?
Comment 3 berkin ozisikyilmaz` 2007-07-24 18:49:27 UTC
I was trying to see how different optimizations effect execution speed of the application, i.e. trying to see if removing that compiler optimization increases/decreases the execution time. Currently i am trying the options specified in the gcc manual, and one of my applications compiles properly, while the one submitted here doesn't. 
(In reply to comment #2)
> Is there a reason why you are using -fno-unit-at-a-time ?
> 
Comment 4 Volker Reichelt 2007-12-28 16:40:12 UTC
Confirmed. Here's a reduced testcase that segfaults when compiled with
"-O -fopenmp -fno-unit-at-a-time":

========================
inline void foo()
{
#pragma omp parallel
  for (;;) ;
}

void bar()
{
  foo();
}
========================

Although the bug is still present on the 4.2 branch, it seems to be fixed
on mainline. So closing, since this is not a regression.