Bug 114373 - [12/13 Regression] BLOCK construct not correctly analyzed with -fopenmp
Summary: [12/13 Regression] BLOCK construct not correctly analyzed with -fopenmp
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 13.2.0
: P4 normal
Target Milestone: 13.4
Assignee: Not yet assigned to anyone
URL:
Keywords: needs-bisection, openmp
Depends on:
Blocks:
 
Reported: 2024-03-18 06:21 UTC by Jens-Olaf Beismann
Modified: 2024-05-21 09:19 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 10.5.0, 11.4.1, 14.0, 9.5.0
Known to fail: 12.3.1, 13.2.1
Last reconfirmed: 2024-03-18 00:00:00


Attachments
Test code (827 bytes, application/x-compressed)
2024-03-18 06:21 UTC, Jens-Olaf Beismann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens-Olaf Beismann 2024-03-18 06:21:51 UTC
Created attachment 57721 [details]
Test code

Following error messages are erroneously issued when compiling with -fopenmp:

% gfortran -c -fopenmp tfx.f90 
tfx.f90:17:58:

   17 |         goto_9999 = .TRUE.  ;  EXIT store_field_critical_0
      |                                                          1
Error: EXIT statement at (1) is not within construct 'store_field_critical_0'
tfx.f90:27:60:

   27 |           goto_9999 = .TRUE.  ;  EXIT store_field_critical_0
      |                                                            1
Error: EXIT statement at (1) is not within construct 'store_field_critical_0'
tfx.f90:31:34:

   31 |   END BLOCK store_field_critical_0
      |                                  1
Error: Syntax error in END BLOCK statement at (1)
tfx.f90:32:34:

   32 | !$OMP END CRITICAL (store_field_0)
      |                                  1
Error: Unexpected !$OMP END CRITICAL statement at (1)
tfx.f90:37:3:

   37 | END SUBROUTINE store_field
      |   1
Error: Expecting END BLOCK statement at (1)
f951: Error: Unexpected end of file in 'tfx.f90'

Compilation without OpenMP support or with compiler versions 11.2.0 or earlier works as expected. Test code and compiler version information attached.

Thank you and best regards,

Jens-Olaf
Comment 1 anlauf 2024-03-18 17:28:38 UTC
Appears to be fixed on 14-mainline.

Can we identify the fix for it?
Comment 2 Jakub Jelinek 2024-05-21 09:19:38 UTC
GCC 13.3 is being released, retargeting bugs to GCC 13.4.