Bug 85738 - internal compiler error: verify_gimple failed
Summary: internal compiler error: verify_gimple failed
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid, ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2018-05-10 18:41 UTC by Marek Polacek
Modified: 2021-12-17 22:37 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 7.3.1
Last reconfirmed: 2021-12-17 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Polacek 2018-05-10 18:41:57 UTC
With this invalid code:

module test
contains
  function gx(l)
    implicit none
    integer, intent(in) :: l
    integer, external :: fx
    real(8) :: gx
    gx=fx(l)**2/(2*(2*l + 1))
  end function gx
end module test

function fx(l)
  implicit none
  integer, intent(in) :: l
  real(8) :: fx
  fx = l
end function fx

I get
$ ./f951 -quiet z.f90
z.f90:3:0:

   function gx(l)
 
Error: type mismatch in binary expression
integer(kind=4)

real(kind=8)

integer(kind=4)

_5 = D.3778 / _4;
z.f90:3:0: internal compiler error: verify_gimple failed
0xf9791e verify_gimple_in_seq(gimple*)
	/home/marek/src/gcc/gcc/tree-cfg.c:5021
0xc13c82 gimplify_body(tree_node*, bool)
	/home/marek/src/gcc/gcc/gimplify.c:12715
0xc14162 gimplify_function_tree(tree_node*)
	/home/marek/src/gcc/gcc/gimplify.c:12805
0x9d7e94 cgraph_node::analyze()
	/home/marek/src/gcc/gcc/cgraphunit.c:670
0x9d9779 analyze_functions
	/home/marek/src/gcc/gcc/cgraphunit.c:1131
0x9de439 symbol_table::finalize_compilation_unit()
	/home/marek/src/gcc/gcc/cgraphunit.c:2691
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Comment 1 Richard Biener 2018-05-11 07:50:22 UTC
And with -fno-checking:

t.f90:8:0:

     gx=fx(l)**2/(2*(2*l + 1))
 
internal compiler error: in convert_move, at expr.c:229
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.opensuse.org/> for instructions.