https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100633

            Bug ID: 100633
           Summary: ICE: gfc_trans_omp_workshare(): Bad statement code
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, openmp
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gfortran-12.0.0-alpha20210516 snapshot
(g:4a322345cab10879162a2ddf659fb0f873ba0182) ICEs when compiling the following
testcase, extracted from test/Semantics/omp-workshare03.f90 from the flang
12.0.0 test suite, w/ -fopenmp:

module defined_assign
  interface assignment(=)
    module procedure work_assign
  end interface

  contains
    subroutine work_assign(a,b)
      integer, intent(out) :: a
      logical, intent(in) :: b(:)
    end subroutine work_assign
end module defined_assign

program omp_workshare
  use defined_assign

  integer :: a
  logical :: l(10)
  l = .TRUE.

  !$omp workshare
  a = l
  !$omp end workshare

end program omp_workshare

% gfortran-12.0.0 -fopenmp -c dd24tjoy.f90
f951: internal compiler error: gfc_trans_omp_workshare(): Bad statement code
0x82f5c9 gfc_report_diagnostic
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210516/work/gcc-12-20210516/gcc/fortran/error.c:782
0x82f5c9 gfc_internal_error(char const*, ...)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210516/work/gcc-12-20210516/gcc/fortran/error.c:1402
0x9757ea gfc_trans_omp_workshare
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210516/work/gcc-12-20210516/gcc/fortran/trans-openmp.c:6128
0x8f1645 trans_code
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210516/work/gcc-12-20210516/gcc/fortran/trans.c:2209
0x921313 gfc_generate_function_code(gfc_namespace*)
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210516/work/gcc-12-20210516/gcc/fortran/trans-decl.c:6885
0x89a917 translate_all_program_units
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210516/work/gcc-12-20210516/gcc/fortran/parse.c:6370
0x89a917 gfc_parse_file()
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210516/work/gcc-12-20210516/gcc/fortran/parse.c:6639
0x8ee74f gfc_be_parse_file
       
/var/tmp/portage/sys-devel/gcc-12.0.0_alpha20210516/work/gcc-12-20210516/gcc/fortran/f95-lang.c:212

Reply via email to