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

            Bug ID: 61644
           Summary: [4.10 Regression] ICE with LTO in expand_expr_real_1
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Joost.VandeVondele at mat dot ethz.ch

A recent regression introduced in the one day between good: r212096 bad:
r212117 causes an ICE on trunk.

> cat bug.f90
MODULE hfx_contract_block
  INTEGER, PARAMETER :: dp=8
CONTAINS
  SUBROUTINE contract_block(ma_max,mb_max,mc_max,md_max,kbd,&
                     kbc,kad,kac,pbd,pbc,pad,pac,prim,scale)
    REAL(KIND=dp) :: kbd(mb_max*md_max), kbc(mb_max*mc_max), &
      prim(ma_max*mb_max*mc_max*md_max), scale
    CALL block_1_1_1_1(kbd,kbc,kad,kac,pbd,pbc,pad,pac,prim,scale)
  END SUBROUTINE contract_block
END MODULE hfx_contract_block


> gfortran -flto  -O0 bug.f90 
bug.f90: In function ‘contract_block’:
bug.f90:8:0: internal compiler error: Segmentation fault
     CALL block_1_1_1_1(kbd,kbc,kad,kac,pbd,pbc,pad,pac,prim,scale)
 ^
0x9368bf crash_signal
    ../../gcc/gcc/toplev.c:337
0x5b686d initialize_argument_information
    ../../gcc/gcc/calls.c:1221
0x5ba69c expand_call(tree_node*, rtx_def*, int)
    ../../gcc/gcc/calls.c:2533
0x6a41de expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
    ../../gcc/gcc/expr.c:10347
0x5cdfa9 expand_expr
    ../../gcc/gcc/expr.h:451
0x5cdfa9 expand_call_stmt
    ../../gcc/gcc/cfgexpand.c:2307
0x5cdfa9 expand_gimple_stmt_1
    ../../gcc/gcc/cfgexpand.c:3202
0x5cdfa9 expand_gimple_stmt
    ../../gcc/gcc/cfgexpand.c:3354
0x5cf0d7 expand_gimple_basic_block
    ../../gcc/gcc/cfgexpand.c:5192
0x5d288a execute
    ../../gcc/gcc/cfgexpand.c:5799

note that -flto is required (and that obviously this reduced testcase will fail
to link if the ice is not present), and that all observed failures (for
compiling our code base) seem to involve expand_expr_real_1.

Reply via email to