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

Harald Anlauf <anlauf at gmx dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gmx dot de

--- Comment #2 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Dominique d'Humieres from comment #0)
> Compiling gfortran.fortran-torture/execute/entry_4.f90 with -O1 or -Os and
> -fdefault-integer-8 gives an ICE for gcc4.9 up to trunk (8.0)
> 
> during RTL pass: expand
> /opt/gcc/p_work/gcc/testsuite/gfortran.fortran-torture/execute/entry_4.f90:
> 14:0:
> 
>   logical e2
>  
> internal compiler error: in gen_lowpart_general, at rtlhooks.c:63

Reducing further gives a traceback:

        complex function f2 (a)
        implicit none
        integer(8) a
!       logical(4) e2           ! Compiles
        logical(8) e2           ! ICE
        entry e2 (a)
        if (a .gt. 0) then
          e2 = a .lt. 46
        else
          f2 = 45
        endif
        end function

during RTL pass: expand
pr84779.f90:5:0:

    5 |   logical(8) e2           ! ICE
      | 
internal compiler error: in gen_lowpart_general, at rtlhooks.c:63
0xc334a8 gen_lowpart_general(machine_mode, rtx_def*)
        ../../trunk/gcc/rtlhooks.c:63
0x90b604 extract_bit_field_1
        ../../trunk/gcc/expmed.c:1763
0x90c34c extract_bit_field(rtx_def*, poly_int<1u, unsigned long>, poly_int<1u,
unsigned long>, int, rtx_def*, machine_mode, machine_mode, bool, rtx_def**)
        ../../trunk/gcc/expmed.c:2097
0x928e5f expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ../../trunk/gcc/expr.c:11043
0x9283cb expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ../../trunk/gcc/expr.c:9858
0x7f2193 expand_expr
        ../../trunk/gcc/expr.h:279
0x7f2193 expand_return
        ../../trunk/gcc/cfgexpand.c:3588
0x7f2193 expand_gimple_stmt_1
        ../../trunk/gcc/cfgexpand.c:3691
0x7f2193 expand_gimple_stmt
        ../../trunk/gcc/cfgexpand.c:3818
0x7f47ff expand_gimple_basic_block
        ../../trunk/gcc/cfgexpand.c:5854
0x7fa8ee execute
        ../../trunk/gcc/cfgexpand.c:6476


Without -fdefault-integer-8 one gets:
pr84779.f90:5:15:

    5 |   logical(8) e2           ! ICE
      |               1
Error: ENTRY result e2 can't be of type LOGICAL(8) in FUNCTION f2 at (1)

I think this is wrong and maybe points to where to look.

Reply via email to