[Bug middle-end/102415] [12 Regression] ICE in bb_seq_addr, at gimple.h:1786

2021-09-22 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102415

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #3 from Jakub Jelinek  ---
Fixed.

[Bug middle-end/102415] [12 Regression] ICE in bb_seq_addr, at gimple.h:1786

2021-09-22 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102415

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:c4432b2776aeeffee9125bf87ff937e4a8907bbd

commit r12-3779-gc4432b2776aeeffee9125bf87ff937e4a8907bbd
Author: Jakub Jelinek 
Date:   Wed Sep 22 09:32:32 2021 +0200

openmp: Fix OpenMP expansion of scope with non-fallthrugh body [PR102415]

I've used function for omp single expansion also for omp scope.  That is
mostly ok, but as the testcase shows, there is one important difference.
The omp single expansion always has a fallthru body, because it during
omp lowering expands the body as if wrapped in an if to simulate that
one thread runs the body and others wait (unless nowait) until it completes
and continue.  omp scope is invoked by all threads and so if the body
is non-fallthru, the barrier (unless nowait) at the end will not be reached
by any of the threads.

The following patch fixes that by handling the case where cfg pass
optimizes
away the exit bb of it gracefully.

2021-09-22  Jakub Jelinek  

PR middle-end/102415
* omp-expand.c (expand_omp_single): If region->exit is NULL,
assert region->entry is GIMPLE_OMP_SCOPE region and return.

* c-c++-common/gomp/scope-3.c: New test.

[Bug middle-end/102415] [12 Regression] ICE in bb_seq_addr, at gimple.h:1786

2021-09-21 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102415

--- Comment #1 from Jakub Jelinek  ---
Created attachment 51491
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51491=edit
gcc12-pr102415.patch

Untested fix.