when compiling : /Develop/mainline_parallel/gcc/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c -w -O1 -ftree-parallelize-loops=4 We get compiler error during verify_flow_info comp-goto-1.c:57: error: label sim_base_addr has incorrect context in bb 8 The context for sim_base_addr is the new outlined function, simulator_kernel._loopfn.0 and not simulator_kernel as expected. while
Confirmed. Shorter testcase that crashes with "-O -ftree-parallelize-loops=2" (on i686-pc-linux-gnu): ============================= void foo(int n, void** p) { int i; for (i = 0; i < n; ++i) p[i] = &&L; L: goto **p; } ============================= The crash happens since GCC 4.3.0 where -ftree-parallelize-loops was introduced.
Btw, the error message is a little hosed: bug.c: In function 'foo': bug.c:2: error: label L has incorrect context in bb 8bug.c:7: internal compiler error: verify_flow_info failed Please submit a full bug report, [etc.] It looks like most of the fprintf statements in gimple_verify_flow_info lack a trailing "\n".
*** Bug 38154 has been marked as a duplicate of this bug. ***
A bit different testcase, crashes on x86_64-pc-linux-gnu, r165719 ----- testcase.c ----- void foo (void **a, int i) { while (i--) a[i] = &&label; label:; } ---------------------- $ gcc -O -ftree-parallelize-loops=2 testcase.c testcase.c: In function 'foo': testcase.c:2:1: error: label label has incorrect context in bb 6testcase.c:2:1: internal compiler error: verify_flow_info failed Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. -ftree-parallelize-loops=N, crashes for N>=2
Still fails with the latest trunk on both powerpc64 and powerpc64le: $ cat a.c && /build/gcc-trunk/gcc/xgcc -B /build/gcc-trunk/gcc -O -Wall -ftree-parallelize-loops=2 a.c void foo(int n, void** p) { int i; for (i = 0; i < n; ++i) p[i] = &&L; L: goto **p; } a.c: In function ‘foo’: a.c:1:6: error: label void foo(int n, void** p) ^~~ L has incorrect context in bb 9a.c:1:6: internal compiler error: verify_flow_info failed 0x1055b0fb verify_flow_info() /src/gcc-trunk/gcc/cfghooks.c:260 0x10d7ec33 checking_verify_flow_info /src/gcc-trunk/gcc/cfghooks.h:198 0x10d81a87 cleanup_tree_cfg_noloop /src/gcc-trunk/gcc/tree-cfgcleanup.c:766 0x10d81bd3 cleanup_tree_cfg() /src/gcc-trunk/gcc/tree-cfgcleanup.c:812 0x10af0f47 execute_expand_omp /src/gcc-trunk/gcc/omp-low.c:13929 0x10af120f execute /src/gcc-trunk/gcc/omp-low.c:14012 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.
This was fixed with Jakub's patch for PR81867 which was applied to trunk and the GCC 7, GCC 6, and GCC 5 branches: https://gcc.gnu.org/ml/gcc-cvs/2017-08/msg00266.html Author: jakub Date: Thu Aug 10 00:33:20 2017 New Revision: 251019 URL: https://gcc.gnu.org/viewcvs?rev=251019&root=gcc&view=rev Log: PR c/81687 * omp-low.c (omp_copy_decl): Don't remap FORCED_LABEL or DECL_NONLOCAL LABEL_DECLs. * tree-cfg.c (move_stmt_op): Don't adjust DECL_CONTEXT of FORCED_LABEL or DECL_NONLOCAL labels. (move_stmt_r) <case GIMPLE_LABEL>: Adjust DECL_CONTEXT of FORCED_LABEL or DECL_NONLOCAL labels here. * testsuite/libgomp.c/pr81687-1.c: New test. * testsuite/libgomp.c/pr81687-2.c: New test. Added: trunk/libgomp/testsuite/libgomp.c/pr81687-1.c trunk/libgomp/testsuite/libgomp.c/pr81687-2.c Modified: trunk/gcc/ChangeLog trunk/gcc/omp-low.c trunk/gcc/tree-cfg.c trunk/libgomp/ChangeLog Jakub, do you want to add the testcase from comment #1 to the testsuite (which fails more reliably than the original testcase or the testcase from comment #4 at least on x86_64-pc-linux-gnu). Or do you think the testcases you added are sufficient?