The attached code ICE's with -fopenmp and -O2, but not with just -fopenmp I build both the recent trunk (svn 110282) and the gomp branch, and it ICE's with both. /home/perrin/GOMP/INSTALL/110296/bin/gcc -Wall -std=c99 -v --save-temps -O2 -fopenmp -m64 -o test_gomp_2 test_gomp_2.c Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: /home/perrin/GOMP/gomp-20050608-branch/configure --prefix=/home/perrin/GOMP/INSTALL/110296/ --enable-threads=posix --enable-languages=c,c++,fortran Thread model: posix gcc version 4.2.0-gomp-20050608-branch 20060126 (experimental) (merged 20060126) /home/perrin/GOMP/INSTALL/110296/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.2.0-gomp-20050608-branch/cc1 -E -quiet -v -iprefix /home/perrin/GOMP/INSTALL/110296/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.0-gomp-20050608-branch/ -D_REENTRANT test_gomp_2.c -m64 -mtune=generic -std=c99 -Wall -fopenmp -O2 -fpch-preprocess -o test_gomp_2.i ignoring nonexistent directory "/home/perrin/GOMP/INSTALL/110296/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.0-gomp-20050608-branch/../../../../x86_64-unknown-linux-gnu/include" ignoring duplicate directory "/home/perrin/GOMP/INSTALL/110296//lib/gcc/x86_64-unknown-linux-gnu/4.2.0-gomp-20050608-branch/include" ignoring nonexistent directory "/home/perrin/GOMP/INSTALL/110296//lib/gcc/x86_64-unknown-linux-gnu/4.2.0-gomp-20050608-branch/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /home/perrin/GOMP/INSTALL/110296/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.0-gomp-20050608-branch/include /usr/local/include /home/perrin/GOMP/INSTALL/110296//include /usr/include End of search list. /home/perrin/GOMP/INSTALL/110296/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.2.0-gomp-20050608-branch/cc1 -fpreprocessed test_gomp_2.i -quiet -dumpbase test_gomp_2.c -m64 -mtune=generic -auxbase test_gomp_2 -O2 -Wall -std=c99 -version -fopenmp -o test_gomp_2.s GNU C version 4.2.0-gomp-20050608-branch 20060126 (experimental) (merged 20060126) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.2.0-gomp-20050608-branch 20060126 (experimental) (merged 20060126). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Compiler executable checksum: b18775707d7fd6662765314b1efc240e test_gomp_2.c: In function 'main': test_gomp_2.c:121: warning: unused variable 'HH' test_gomp_2.c:120: warning: unused variable 'GG' test_gomp_2.c: In function 'main.omp_fn.1': test_gomp_2.c:223: 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: *** [test_gomp] Error 1
Created attachment 10740 [details] fails with -fopenmp and -O2 contains two #pragama omp parallel for loops
This is a GC failure: #0 ggc_set_mark (p=0xafafafafafafafaf) at /home/pinskia/src/checkin/trunk/gcc/ggc-page.c:588 #1 0x0000000000620268 in gt_ggc_mx_basic_block_def (x_p=Variable "x_p" is not available. ) at gtype-desc.c:462 #2 0x000000000062060f in gt_ggc_mx_VEC_basic_block_gc (x_p=Variable "x_p" is not available. ) at gtype-desc.c:193 #3 0x0000000000620673 in gt_ggc_mx_control_flow_graph (x_p=Variable "x_p" is not available. ) at gtype-desc.c:624 #4 0x000000000062072f in gt_ggc_mx_function (x_p=Variable "x_p" is not available. ) at gtype-desc.c:639 #5 0x0000000000409622 in gt_ggc_mx_lang_tree_node (x_p=Variable "x_p" is not available. ) at gt-c-decl.h:315 #6 0x0000000000619df7 in gt_ggc_mx_cgraph_node (x_p=Variable "x_p" is not available. ) at gtype-desc.c:166 #7 0x0000000000619f16 in gt_ggc_m_P11cgraph_node4htab (x_p=Variable "x_p" is not available. ) at gtype-desc.c:1694
You can reproduce this with -std=c99 -fopenmp --param ggc-min-expand=0 --param ggc-min-heapsize=0
Reducing.
Reduced testcase: __strcspn_c2 (__const char *__s, int __reject1, int __reject2) { int m = 1,n = 1,s = 1; int DD,EE,num_s; int m_max = 99; int n_max = 00; for ( n = 1 ; n <= 99 ; n++ ) for ( m = 1 ; m <= 99 ; m++ ) for ( m = 1 ; m <= m_max ; m++) for ( s = 1 ; s <= num_s ; s++) { int liter ; #pragma omp parallel for private(m,liter,s) for ( n = 1 ; n <= n_max ; n++) {} } }
Even simpler testcase: ============================================== void foo() { int i; for ( i=0; i<1; i++ ) ; for ( i=0; i<1; i++ ) ; for ( i=0; i<1; i++ ) ; for ( i=0; i<1; i++ ) ; for ( i=0; i<1; i++ ) ; #pragma omp parallel ; } ==============================================
Hi Diego, did you have a look at this one? This makes -fopenmp almost unusable for the C++ frontend. PR 26032 is probably a duplicate of this one. I stumbled over the bug independently, too.
Mine.
And you can add PR 25983 on top of it :)
I can't reproduced this with trunk@110474 nor gomp@110467. Could you please try again?
I still get a segfault for the testcase in comment #6. This is revision 110467 on x86_64-unknown-linux-gnu. Note, that this is with the C frontend: gcc -fopenmp --param ggc-min-expand=0 --param ggc-min-heapsize=0 -c PR25990.c
I can still confirm it too.
(In reply to comment #11) > I still get a segfault for the testcase in comment #6. > This is revision 110467 on x86_64-unknown-linux-gnu. > Ah, yes. I had failed to notice the failure is on x86_64. Sorry about that.
Subject: Bug 25990 Author: dnovillo Date: Thu Feb 2 12:27:02 2006 New Revision: 110511 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110511 Log: PR 25990 * tree-cfg.c (move_block_to_fn): Clear out the basic block array after growing it. testsuite/ PR 25990 * gcc.dg/gomp/pr25990.c: New test. Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-cfg.c
Fixed. http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00121.html