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

            Bug ID: 95375
           Summary: ICE in add_use_op, Error: mismatching comparison
                    operand types
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

An inconsistent interface hits versions down to at least r5 :
(detected without bind(c))


$ cat z1.f90
function f() result(n) bind(c)
   class(*), allocatable :: n
end
program p
   interface
      function f() result(n) bind(c)
         integer :: n
      end
   end interface
   if ( f() /= 0 ) stop
end


$ gfortran-11-20200524 -c z1.f90
during GIMPLE pass: ssa
z1.f90:11:0:

   11 | end
      |
internal compiler error: Segmentation fault
0xbc0f6f crash_signal
        ../../gcc/toplev.c:328
0xd0a3e0 add_use_op
        ../../gcc/tree-ssa-operands.c:377
0xd0a3e0 operands_scanner::finalize_ssa_uses()
        ../../gcc/tree-ssa-operands.c:480
0xd0a3e0 operands_scanner::finalize_ssa_stmt_operands()
        ../../gcc/tree-ssa-operands.c:506
0xd0a3e0 operands_scanner::build_ssa_operands()
        ../../gcc/tree-ssa-operands.c:1014
0xd0aa10 update_stmt_operands(function*, gimple*)
        ../../gcc/tree-ssa-operands.c:1155
0xc3a754 update_stmt
        ../../gcc/gimple-ssa.h:175
0xc3a754 mark_def_sites
        ../../gcc/tree-into-ssa.c:649
0xc3a754 mark_def_dom_walker::before_dom_children(basic_block_def*)
        ../../gcc/tree-into-ssa.c:2342
0x13a3e44 dom_walker::walk(basic_block_def*)
        ../../gcc/domwalk.c:309
0xc3cd85 execute
        ../../gcc/tree-into-ssa.c:2459



Configured with --enable-checking=yes :

$ gfortran-11-20200524 -c z1.f90
z1.f90:4:0:

    4 | program p
      |
Error: mismatching comparison operand types
struct __class__STAR_a
integer(kind=4)
if (D.3926 != 0) goto <D.3927>; else goto <D.3928>;
z1.f90:4:0: internal compiler error: 'verify_gimple' failed
0xd9b27d verify_gimple_in_seq(gimple*)
        ../../gcc/tree-cfg.c:5113
0xa526b1 gimplify_body(tree_node*, bool)
        ../../gcc/gimplify.c:14919
0xa52967 gimplify_function_tree(tree_node*)
        ../../gcc/gimplify.c:14990
0x88d9e7 cgraph_node::analyze()
        ../../gcc/cgraphunit.c:671
0x890e21 analyze_functions
        ../../gcc/cgraphunit.c:1231
0x892042 symbol_table::finalize_compilation_unit()
        ../../gcc/cgraphunit.c:2975

Reply via email to