The following test

  function bar (i) result(yy)
    integer i, j, k
    character (len = i) :: yy(2)
    do j = 1, size (yy, 1)
      do k = 1, i
        yy(j)(k:k) = char (96+k)
      end do
    end do
  end function bar

ICE when compiled at revision 160112:

[macbook] f90/bug% gfc -O3 char_result_13_red.f90
char_result_13_red.f90: In function 'bar':
char_result_13_red.f90:6:0: internal compiler error: Segmentation fault

The test has been extracted gcc/testsuite/gfortran.dg/char_result_13.f90 which
passed at revision 160060. The backtrace is:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000010
remove_insn (insn=0x141e71828) at ../../work/gcc/emit-rtl.c:3859
3859          PREV_INSN (next) = NULL;
(gdb) bt
#0  remove_insn (insn=0x141e71828) at ../../work/gcc/emit-rtl.c:3859
#1  0x00000001008cf0d0 in expand_vselect (target=<value temporarily
unavailable, due to optimizations>, op0=<value temporarily unavailable, due to
optimizations>, perm=<value temporarily unavailable, due to optimizations>,
nelt=8) at ../../work/gcc/config/i386/i386.c:29419
#2  0x00000001008cf342 in expand_vec_perm_1 (d=0x7fff5fbfc730) at
../../work/gcc/config/i386/i386.c:29686
#3  0x00000001009024a6 in ix86_expand_vec_extract_even_odd (targ=<value
temporarily unavailable, due to optimizations>, op0=<value temporarily
unavailable, due to optimizations>, op1=<value temporarily unavailable, due to
optimizations>, odd=0) at ../../work/gcc/config/i386/i386.c:30480
#4  0x0000000100295b18 in gen_vec_pack_trunc_v4si (operand0=0x141e70fe0,
operand1=<value temporarily unavailable, due to optimizations>,
operand2=0x141e70f80) at sse.md:6651
#5  0x000000010060df27 in expand_binop_directly (mode=V4SImode,
binoptab=0x100ca4ed8, op0=0x141e70f00, op1=0x141e70f80, target=0x0,
unsignedp=0, methods=OPTAB_LIB_WIDEN, last=0x141e71798) at
../../work/gcc/optabs.c:1513
#6  0x0000000100609827 in expand_binop (mode=V4SImode, binoptab=0x100ca4ed8,
op0=0x141e70f00, op1=0x141e70f80, target=0x0, unsignedp=0,
methods=OPTAB_LIB_WIDEN) at ../../work/gcc/optabs.c:1579
#7  0x0000000100475695 in expand_expr_real_2 (ops=<value temporarily
unavailable, due to optimizations>, target=0x0, tmode=VOIDmode,
modifier=EXPAND_NORMAL) at ../../work/gcc/expr.c:8263
#8  0x0000000100466b93 in expand_expr_real_1 (exp=0x141e6fb98, target=<value
temporarily unavailable, due to optimizations>, tmode=VOIDmode,
modifier=EXPAND_NORMAL, alt_rtl=0x0) at ../../work/gcc/expr.c:9660
#9  0x000000010046c7ef in expand_expr_real (exp=0x141e6fb98, target=<value
temporarily unavailable, due to optimizations>, tmode=<value temporarily
unavailable, due to optimizations>, modifier=<value temporarily unavailable,
due to optimizations>, alt_rtl=<value temporarily unavailable, due to
optimizations>) at ../../work/gcc/expr.c:7198
#10 0x00000001004684e3 in expand_expr_real_1 (exp=0x141e49f20, target=<value
temporarily unavailable, due to optimizations>, tmode=VOIDmode,
modifier=EXPAND_NORMAL, alt_rtl=0x0) at expr.h:558
#11 0x000000010046cb0a in expand_operands (exp0=0x141e49f20, exp1=0x141e4f000,
target=0x0, op0=0x7fff5fbfcea8, op1=0x7fff5fbfcea0, modifier=EXPAND_NORMAL) at
expr.h:558
#12 0x000000010047565a in expand_expr_real_2 (ops=<value temporarily
unavailable, due to optimizations>, target=0x141e72150, tmode=V16QImode,
modifier=EXPAND_NORMAL) at ../../work/gcc/expr.c:8256
#13 0x0000000100466b93 in expand_expr_real_1 (exp=0x141e6fb60, target=<value
temporarily unavailable, due to optimizations>, tmode=V16QImode,
modifier=EXPAND_NORMAL, alt_rtl=0x0) at ../../work/gcc/expr.c:9660
#14 0x000000010046c7ef in expand_expr_real (exp=0x141e6fb60, target=<value
temporarily unavailable, due to optimizations>, tmode=<value temporarily
unavailable, due to optimizations>, modifier=<value temporarily unavailable,
due to optimizations>, alt_rtl=<value temporarily unavailable, due to
optimizations>) at ../../work/gcc/expr.c:7198
#15 0x00000001004684e3 in expand_expr_real_1 (exp=0x141e4f0b0, target=<value
temporarily unavailable, due to optimizations>, tmode=V16QImode,
modifier=EXPAND_NORMAL, alt_rtl=0x7fff5fbfd2c8) at expr.h:558
#16 0x00000001004732aa in store_expr (exp=0x141e4f0b0, target=0x141e72150,
call_param_p=0, nontemporal=0 '\0') at ../../work/gcc/expr.c:4688
#17 0x0000000100479749 in expand_assignment (to=0x141e4fd68, from=0x141e4f0b0,
nontemporal=0 '\0') at ../../work/gcc/expr.c:4472
#18 0x000000010038ce72 in expand_gimple_stmt (stmt=0x141e48460) at
../../work/gcc/cfgexpand.c:1873
#19 0x000000010038e3b7 in expand_gimple_basic_block (bb=0x141d59a90) at
../../work/gcc/cfgexpand.c:3403
#20 0x00000001003930d1 in gimple_expand_cfg () at
../../work/gcc/cfgexpand.c:3855
#21 0x0000000100622624 in execute_one_pass (pass=0x100bfa320) at
../../work/gcc/passes.c:1576
#22 0x00000001006228fd in execute_pass_list (pass=0x100bfa320) at
../../work/gcc/passes.c:1631
#23 0x000000010074f7cc in tree_rest_of_compilation (fndecl=0x141e15300) at
../../work/gcc/tree-optimize.c:410
#24 0x000000010090e8c0 in cgraph_expand_function (node=0x141d2a560) at
../../work/gcc/cgraphunit.c:1632
#25 0x0000000100911799 in cgraph_optimize () at
../../work/gcc/cgraphunit.c:1711
#26 0x0000000100911e2a in cgraph_finalize_compilation_unit () at
../../work/gcc/cgraphunit.c:1171
#27 0x00000001005b3176 in write_global_declarations () at
../../work/gcc/langhooks.c:310
#28 0x00000001006ea493 in toplev_main (argc=3, argv=0x7fff5fbfd920) at
../../work/gcc/toplev.c:1054
#29 0x0000000100000df4 in start ()


-- 
           Summary: [4.6 Regression] ICE with -O3 at revision 160112
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dominiq at lps dot ens dot fr
 GCC build triplet: x86_64-apple-darwin10
  GCC host triplet: x86_64-apple-darwin10
GCC target triplet: x86_64-apple-darwin10


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44369

Reply via email to