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

            Bug ID: 83740
           Summary: [8 Regression] ICE in maybe_legitimize_operand, at
                    optabs.c:7140
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

With testfiles array_constructor_17.f90 or string_array_constructor_3.f90
from ./gcc/testsuite/gfortran.dg, and with -fcheck=all or -fcheck=bounds.

Simplified testcase :

$ cat z1.f90
program p
   print *, [(f(3), i = 1, 2)]
contains
   function f(n) result(z)
      integer :: n
      character(n) :: z
      z = 'abc'
   end
end


$ gfortran-8-20171217 -c z1.f90 -fcheck=all
$
$ gfortran-8-20180107 -c z1.f90
$
$ gfortran-8-20180107 -c z1.f90 -fcheck=all
during RTL pass: expand
z1.f90:2:0:

    print *, [(f(3), i = 1, 2)]

internal compiler error: in maybe_legitimize_operand, at optabs.c:7140
0xaa9174 maybe_legitimize_operand
        ../../gcc/optabs.c:7139
0xaa9174 maybe_legitimize_operands(insn_code, unsigned int, unsigned int,
expand_operand*)
        ../../gcc/optabs.c:7211
0xaa9399 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
        ../../gcc/optabs.c:7229
0xaaba8a maybe_expand_insn(insn_code, unsigned int, expand_operand*)
        ../../gcc/optabs.c:7272
0xaaba8a emit_conditional_move(rtx_def*, rtx_code, rtx_def*, rtx_def*,
machine_mode, rtx_def*, rtx_def*, machine_mode, int)
        ../../gcc/optabs.c:4348
0x8fb7e5 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
        ../../gcc/expr.c:9173
0x7fd05d expand_gimple_stmt_1
        ../../gcc/cfgexpand.c:3729
0x7fd05d expand_gimple_stmt
        ../../gcc/cfgexpand.c:3790
0x7fe43b expand_gimple_basic_block
        ../../gcc/cfgexpand.c:5810
0x803846 execute
        ../../gcc/cfgexpand.c:6416

Reply via email to