Between revisions 163595 (working) and 163628 (failing) compiling
gfortran.dg/transfer_simplify_2.f90  with -O2 -m64 gives an ICE

[karma] f90/bug% gfc -O2 -m64
/opt/gcc/_gcc_clean/gcc/testsuite/gfortran.dg/transfer_simplify_2.f90: In
function 'main':
error: insn does not satisfy its constraints:
(insn 627 117 628 6 (set (reg:DI 32 f0)
        (mem/u/c:DI (lo_sum:DI (reg:DI 2 r2 [282])
                (const:DI (unspec:DI [
                            (symbol_ref:DI ("l2.1497") [flags 0xe02] <var_decl
0x417a9c00 l2>)
                        ] 50))) [0 MEM[(c_char * {ref-all})&l2]+0 S8 A32]))
/opt/gcc/_gcc_clean/gcc/testsuite/gfortran.dg/transfer_simplify_2.f90:59 9
     (expr_list:REG_DEAD (reg:DI 2 r2 [282])
internal compiler error: in copyprop_hardreg_forward_1, at regcprop.c:768

Reduced test case (after commenting the line 'call logical4_to_real8' in the
original code, it compiles and run)

  implicit none
  call logical4_to_real8

  subroutine logical4_to_real8
    logical(4), parameter ::  l1(2) = (/.false., .true./)
    logical(4)            ::  l2(2) = l1
    real(8), parameter    ::  r1 = transfer (l1, 1_8)
    real(8)               ::  r2

    r2 = transfer (l2, 1_8);
    if (r1 .ne. r2) call abort ()
  end subroutine logical4_to_real8


and backtrace

 MAIN__ logical4_to_real8 main
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data> <visibility> <early_local_cleanups> <emutls> <whole-program>
<ipa-profile> <cp> <inline> <pure-const> <static-var>Assembling functions:
transfer_simplify_2_red.f90: In function 'main':
transfer_simplify_2_red.f90:2:0: error: insn does not satisfy its constraints:
(insn 50 15 51 2 (set (reg:DI 32 f0)
        (mem/u/c:DI (lo_sum:DI (reg/f:DI 2 r2 [127])
                (symbol_ref:DI ("l2.1161") [flags 0xe02] <var_decl 0x41778ea0
l2>)) [0 MEM[(c_char * {ref-all})&l2]+0 S8 A32]))
transfer_simplify_2_red.f90:11 9 {movdi_low}
     (expr_list:REG_DEAD (reg/f:DI 2 r2 [127])

Breakpoint 1, fancy_abort (file=0x8fb450 "../../gcc-4.6-work/gcc/regcprop.c",
line=768, function=0xad2fa8 "copyprop_hardreg_forward_1") at
879       internal_error ("in %s, at %s:%d", function, trim_filename (file),
(gdb) bt
#0  fancy_abort (file=0x8fb450 "../../gcc-4.6-work/gcc/regcprop.c", line=768,
function=0xad2fa8 "copyprop_hardreg_forward_1") at
#1  0x00580c68 in _fatal_insn (msgid=<value temporarily unavailable, due to
optimizations>, insn=<value temporarily unavailable, due to optimizations>,
file=<value temporarily unavailable, due to optimizations>, line=<value
temporarily unavailable, due to optimizations>, function=<value temporarily
unavailable, due to optimizations>) at ../../gcc-4.6-work/gcc/rtl-error.c:109
#2  0x00580ca8 in _fatal_insn_not_found (insn=0xa082853c, file=0x300 <Address
0x300 out of bounds>, line=5770344, function=0xa082b45c " &#130;´&#159;") at
#3  0x00557fe8 in copyprop_hardreg_forward () at
#4  0x0052fc0c in execute_one_pass (pass=0xb8f2a0) at
#5  0x0052ff44 in execute_pass_list (pass=0xb8f2a0) at
#6  execute_pass_list (pass=0xb897e4) at ../../gcc-4.6-work/gcc/passes.c:1626
#7  execute_pass_list (pass=0xb89818) at ../../gcc-4.6-work/gcc/passes.c:1626
#8  0x0065cedc in tree_rest_of_compilation (fndecl=0x41779600) at
#9  0x0082020c in cgraph_expand_function (node=0x41707360) at
#10 0x00822ed4 in cgraph_optimize () at
#11 0x00823440 in cgraph_finalize_compilation_unit () at
#12 0x004baca4 in write_global_declarations () at
#13 0x005ed9e0 in toplev_main (argc=4, argv=0x38018f13) at
#14 0x00001990 in start ()

If the line 'if (r1 .ne. r2) call abort ()' is commented the code compiles.

           Summary: [4.6 Regression] ICE on powerpc-apple-darwin9 for
                    gfortran.dg/transfer_simplify_2.f90 with -O2 -m64
           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: powerpc-apple-darwin9
GCC target triplet: powerpc-apple-darwin9

Reply via email to