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

            Bug ID: 77516
           Summary: ICE in is_gimple_min_invariant, at gimple-expr.c:706
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fort...@t-online.de
  Target Milestone: ---

Invalid code with a zero or negative safelen value.
Affects versions 5, 6, 7 (not supported below 5) at -Os, -O1 or higher.


$ cat z1.f90
program p
   integer :: i, x
   x = 0
!$omp simd safelen(0) reduction(+:x)
   do i = 1, 8
      x = x + 1
   end do
   print *, x
end


$ gfortran-7-20160904 -O2 -fopenmp z1.f90
z1.f90:4:0:

 !$omp simd safelen(0) reduction(+:x)

internal compiler error: Segmentation fault
0xc2100f crash_signal
        ../../gcc/toplev.c:336
0x98a370 is_gimple_min_invariant(tree_node const*)
        ../../gcc/gimple-expr.c:706
0x9bc9d0 gimplify_compound_lval
        ../../gcc/gimplify.c:2208
0x9b394a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.c:10495
0x9c6ab5 gimplify_modify_expr
        ../../gcc/gimplify.c:4824
0x9b578a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gimplify.c:10543
0x9b8ae6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gimplify.c:5805
0x9b9621 gimplify_and_add(tree_node*, gimple**)
        ../../gcc/gimplify.c:427
0x9b9621 gimplify_assign(tree_node*, tree_node*, gimple**)
        ../../gcc/gimplify.c:12062
0xb26abb lower_rec_input_clauses
        ../../gcc/omp-low.c:5249
0xb2b8b9 lower_omp_for
        ../../gcc/omp-low.c:15131
0xb1b946 lower_omp_1
        ../../gcc/omp-low.c:17041
0xb1b946 lower_omp
        ../../gcc/omp-low.c:17178
0xb1aadc lower_omp_1
        ../../gcc/omp-low.c:17017
0xb1aadc lower_omp
        ../../gcc/omp-low.c:17178
0xb1b47c lower_omp_1
        ../../gcc/omp-low.c:17026
0xb1b47c lower_omp
        ../../gcc/omp-low.c:17178
0xb2265f execute_lower_omp
        ../../gcc/omp-low.c:17913
0xb2265f execute
        ../../gcc/omp-low.c:17950

Reply via email to