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

            Bug ID: 71247
           Summary: [6 Regression] ICE in expand_expr_real_1, at
                    expr.c:9651
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anlauf at gmx dot de
  Target Milestone: ---

The following code ICEs with 6.0, but not with 5.0 or earlier.
The ICE disappears with -fno-realloc-lhs.

Don't know if it has been already been fixed after the initial 6 release.

% cat gfcbug135.f90 
MODULE gfcbug135
  implicit none
  integer, parameter              :: LEN=256
  character(len=LEN), allocatable :: lines(:)
  integer                         :: n
contains
  subroutine foo1 ()
    integer :: i, j
    j = n
    do i = n, 1, -1
       lines(j) = lines(i)  ! Comment out to avoid ICE
       j = j - 1
    end do
  end subroutine foo1
  !-
  subroutine foo2 ()
    integer :: i,j
    j = n + 3
    do i = n,4,-1
       lines(j) = lines(i)  ! Comment out to avoid ICE
       j = j - 1
    end do
  end subroutine foo2
end module gfcbug135


% gfortran6 -c gfcbug135.f90
gfcbug135.f90:11:0:

        lines(j) = lines(i)  ! Comment out to avoid ICE

internal compiler error: in expand_expr_real_1, at expr.c:9651
0x8dafcb expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ../../gcc-6-20160410/gcc/expr.c:9645
0x8efc4e expand_expr
        ../../gcc-6-20160410/gcc/expr.h:256
0x8efc4e expand_expr_addr_expr_1
        ../../gcc-6-20160410/gcc/expr.c:7672
0x8d71b6 expand_expr_addr_expr
        ../../gcc-6-20160410/gcc/expr.c:7793
0x8d71b6 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ../../gcc-6-20160410/gcc/expr.c:10825
0x8e34a5 store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool,
tree_node*)
        ../../gcc-6-20160410/gcc/expr.c:5406
0x8e4e98 expand_assignment(tree_node*, tree_node*, bool)
        ../../gcc-6-20160410/gcc/expr.c:5175
0x7d899e expand_gimple_stmt_1
        ../../gcc-6-20160410/gcc/cfgexpand.c:3618
0x7d899e expand_gimple_stmt
        ../../gcc-6-20160410/gcc/cfgexpand.c:3714
0x7dae0e expand_gimple_basic_block
        ../../gcc-6-20160410/gcc/cfgexpand.c:5720
0x7e0f46 execute
        ../../gcc-6-20160410/gcc/cfgexpand.c:6335
Please submit a full bug report,
with preprocessed source if appropriate.

Reply via email to