1. g++-11.0.0-alpha20200726 snapshot (g:39ddfef9a5c24acf6412236f52f6716c8e0ebc9e) ICEs when compiling the following testcase, reduced from libgomp/testsuite/libgomp.c/loop-18.c, w/ -fbranch-probabilities -fnon-call-exceptions -fopenmp: int main () { int i, j; #pragma omp for collapse (2) for (i = 0; i < 1; ++i) for (j = 0; j <= i; ++j) { } return 0; } % g++-11.0.0 -fbranch-probabilities -fnon-call-exceptions -fopenmp -c qr6y7wzi.c qr6y7wzi.c: In function 'int main()': qr6y7wzi.c:13:1: error: wrong outgoing edge flags at end of bb 23 13 | } | ^ during IPA pass: profile qr6y7wzi.c:13:1: internal compiler error: verify_flow_info failed 0xb80b56 verify_flow_info() /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200726/work/gcc-11-20200726/gcc/cfghooks.c:269 0x105e7e7 checking_verify_flow_info /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200726/work/gcc-11-20200726/gcc/cfghooks.h:212 0x105e7e7 gimple_flow_call_edges_add /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200726/work/gcc-11-20200726/gcc/tree-cfg.c:8622 0xf81fdd branch_prob(bool) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200726/work/gcc-11-20200726/gcc/profile.c:1099 0x10fe836 tree_profiling /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200726/work/gcc-11-20200726/gcc/tree-profile.c:779 0x10fe836 execute /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200726/work/gcc-11-20200726/gcc/tree-profile.c:885 2. Replacing <= w/ < yields the following instead: --- qr6y7wzi.c +++ #<buffer qr6y7wzi.c> @@ -5,7 +5,7 @@ main () #pragma omp for collapse (2) for (i = 0; i < 1; ++i) - for (j = 0; j <= i; ++j) + for (j = 0; j < i; ++j) { } % g++-11.0.0 -fbranch-probabilities -fnon-call-exceptions -fopenmp -c qr6y7wzi.c during GIMPLE pass: ompexp qr6y7wzi.c: In function 'int main()': qr6y7wzi.c:6:9: internal compiler error: Segmentation fault 6 | #pragma omp for collapse (2) | ^~~ 0x1028baf crash_signal /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200726/work/gcc-11-20200726/gcc/toplev.c:328 0xec69ae contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200726/work/gcc-11-20200726/gcc/tree.h:3416 0xec69ae expand_omp_for_init_vars /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200726/work/gcc-11-20200726/gcc/omp-expand.c:2271 0xeccbe2 expand_omp_for_static_nochunk /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200726/work/gcc-11-20200726/gcc/omp-expand.c:4969 0xedc6b4 expand_omp_for /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200726/work/gcc-11-20200726/gcc/omp-expand.c:7421 0xedcb8a expand_omp /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200726/work/gcc-11-20200726/gcc/omp-expand.c:9691 0xede96c execute_expand_omp /var/tmp/portage/sys-devel/gcc-11.0.0_alpha20200726/work/gcc-11-20200726/gcc/omp-expand.c:9920
Created attachment 49018 [details] gcc11-pr96424.patch Untested fix.
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:87d6dae308d604bad111b1c0bfea7835888eed8d commit r11-2614-g87d6dae308d604bad111b1c0bfea7835888eed8d Author: Jakub Jelinek <jakub@redhat.com> Date: Sat Aug 8 11:07:09 2020 +0200 openmp: Avoid floating point comparison at the end of bb with -fnon-call-exceptions The following testcase ICEs with -fexceptions -fnon-call-exceptions because in that mode floating point comparisons should not be done at the end of bb in GIMPLE_COND. Fixed by forcing it into a bool SSA_NAME and comparing that against false. 2020-08-08 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/96424 * omp-expand.c: Include tree-eh.h. (expand_omp_for_init_vars): Handle -fexceptions -fnon-call-exceptions by forcing floating point comparison into a bool temporary. * c-c++-common/gomp/pr96424.c: New test.
Fixed.