public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/107067] New: [OpenMP] ICE with metadirective block statements
@ 2022-09-28 12:53 parras at gcc dot gnu.org
0 siblings, 0 replies; only message in thread
From: parras at gcc dot gnu.org @ 2022-09-28 12:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107067
Bug ID: 107067
Summary: [OpenMP] ICE with metadirective block statements
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: openmp
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: parras at gcc dot gnu.org
CC: burnus at gcc dot gnu.org
Target Milestone: ---
Created attachment 53636
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53636&action=edit
Test case triggering an ICE
The current OG12 implementation handles OMP metadirectives, but it fails to
parse the following code:
```
!$OMP begin metadirective &
!$OMP when ( user = { condition ( UseDevice ) } &
!$OMP : nothing ) &
!$OMP default ( parallel )
block
call foo()
end block
call bar()
!$omp end metadirective
```
The `call bar()` statement cannot be parsed properly as the parser expects the
`end block` to be immediately followed by `!$omp end metadirective`:
```
f951: internal compiler error: in parse_omp_metadirective_body, at
fortran/parse.cc:5895
0x6d6d6f parse_omp_metadirective_body
/scratch/pauarr3t/build_17657/src/gcc-og12-branch/gcc/fortran/parse.cc:5895
0x6d6d6f parse_executable
/scratch/pauarr3t/build_17657/src/gcc-og12-branch/gcc/fortran/parse.cc:6051
0x7dafb0 parse_progunit
/scratch/pauarr3t/build_17657/src/gcc-og12-branch/gcc/fortran/parse.cc:6349
0x7dc670 gfc_parse_file()
/scratch/pauarr3t/build_17657/src/gcc-og12-branch/gcc/fortran/parse.cc:6872
0x835acf gfc_be_parse_file
/scratch/pauarr3t/build_17657/src/gcc-og12-branch/gcc/fortran/f95-lang.cc:224
```
On the other hand, if `call bar()` comes before the block, it is parsed
correctly.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-28 12:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28 12:53 [Bug fortran/107067] New: [OpenMP] ICE with metadirective block statements parras at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).