https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61200
Bug ID: 61200 Summary: internal compiler error: Segmentation fault, assert & openmp Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: libgomp Assignee: unassigned at gcc dot gnu.org Reporter: psxlover at hotmail dot com CC: jakub at gcc dot gnu.org Created attachment 32807 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32807&action=edit Minimal test case When trying to compile attached file with "-fopenmp" I get a segmentation fault. Tried with gcc 4.4.5 (on debian squeeze), 4.8.2 (on cygwin, fedora 20 and debian wheezy) and 4.9.0 and all of them crash. The problem occurs when there is an assert in a parallel region containing a variable and then you have a task with that variable as share and you access it in any way. The problem doesn't occur if the assert is not in a "#pragma omp parallel" or if you change he following task to parallel, or if you remove the shared directive from the task or finally if you don't access the variable inside the task. The assert call can contain anything as long as it contains the variable that is accessed later in a task. Here is the output of "./gcc-4.9.0/bin/gcc -v -save-temps -fopenmp fopenmpSeg.c": Using built-in specs. COLLECT_GCC=./gcc-4.9.0/bin/gcc COLLECT_LTO_WRAPPER=/home/psxlover/gcc-4.9.0/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /home/psxlover/Downloads/gcc4.9obj/../gcc-4.9.0/configure --prefix=/home/psxlover/gcc-4.9.0 --disable-multilib Thread model: posix gcc version 4.9.0 (GCC) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-fopenmp' '-mtune=generic' '-march=x86-64' '-pthread' /home/psxlover/gcc-4.9.0/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1 -E -quiet -v -D_REENTRANT fopenmpSeg.c -mtune=generic -march=x86-64 -fopenmp -fpch-preprocess -o fopenmpSeg.i ignoring nonexistent directory "/home/psxlover/gcc-4.9.0/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /home/psxlover/gcc-4.9.0/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include /usr/local/include /home/psxlover/gcc-4.9.0/include /home/psxlover/gcc-4.9.0/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/include-fixed /usr/include End of search list. COLLECT_GCC_OPTIONS='-v' '-save-temps' '-fopenmp' '-mtune=generic' '-march=x86-64' '-pthread' /home/psxlover/gcc-4.9.0/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1 -fpreprocessed fopenmpSeg.i -quiet -dumpbase fopenmpSeg.c -mtune=generic -march=x86-64 -auxbase fopenmpSeg -version -fopenmp -o fopenmpSeg.s GNU C (GCC) version 4.9.0 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.9.0, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C (GCC) version 4.9.0 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.9.0, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 24a1e3ed1d75ecc9aae55f188f0fd7ae fopenmpSeg.c: In function ‘main’: fopenmpSeg.c:8:28: internal compiler error: Segmentation fault assert(var == 1); ^ 0x8e103f crash_signal /home/psxlover/Downloads/gcc4.9obj/../gcc-4.9.0/gcc/toplev.c:337 0x7723e1 gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int) /home/psxlover/Downloads/gcc4.9obj/../gcc-4.9.0/gcc/gimplify.c:8376 0x779cd0 gimple_regimplify_operands(gimple_statement_base*, gimple_stmt_iterator*) /home/psxlover/Downloads/gcc4.9obj/../gcc-4.9.0/gcc/gimplify-me.c:172 0x82853b lower_omp_1 /home/psxlover/Downloads/gcc4.9obj/../gcc-4.9.0/gcc/omp-low.c:10139 0x82853b lower_omp /home/psxlover/Downloads/gcc4.9obj/../gcc-4.9.0/gcc/omp-low.c:10151 0x82cca4 lower_omp_taskreg /home/psxlover/Downloads/gcc4.9obj/../gcc-4.9.0/gcc/omp-low.c:9485 0x828dfe lower_omp_1 /home/psxlover/Downloads/gcc4.9obj/../gcc-4.9.0/gcc/omp-low.c:10016 0x828dfe lower_omp /home/psxlover/Downloads/gcc4.9obj/../gcc-4.9.0/gcc/omp-low.c:10151 0x8292dc lower_omp_1 /home/psxlover/Downloads/gcc4.9obj/../gcc-4.9.0/gcc/omp-low.c:10008 0x8292dc lower_omp /home/psxlover/Downloads/gcc4.9obj/../gcc-4.9.0/gcc/omp-low.c:10151 0x82ad6a execute_lower_omp /home/psxlover/Downloads/gcc4.9obj/../gcc-4.9.0/gcc/omp-low.c:10183 0x82ad6a execute /home/psxlover/Downloads/gcc4.9obj/../gcc-4.9.0/gcc/omp-low.c:10222 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.