https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95064
Bug ID: 95064
Summary: [11 regression] ICEs in fortran compiler starting with
r11-255
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: seurer at linux dot vnet.ibm.com
Target Milestone: ---
Several of the spec 2000 test cases (specifically ) ICE when being built now.
Errors are occurring in a couple of different places.
f951: internal compiler error: gfc_divide(): Bad basic type
0x102b464f gfc_report_diagnostic
/home/seurer/gcc/git/gcc-test/gcc/fortran/error.c:782
0x102b62bf gfc_internal_error(char const*, ...)
/home/seurer/gcc/git/gcc-test/gcc/fortran/error.c:1402
0x1026f357 gfc_divide(gfc_expr*, gfc_expr*)
/home/seurer/gcc/git/gcc-test/gcc/fortran/arith.c:1831
0x10301b07 match_add_operand
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:394
0x10301e73 match_level_2
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:480
0x10302073 match_level_3
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:551
0x1030220f match_level_4
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:599
0x1030220f match_and_operand
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:693
0x10302493 match_or_operand
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:722
0x10302603 match_equiv_operand
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:765
0x10302777 match_level_5
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:811
0x103014ff gfc_match_expr(gfc_expr**)
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:870
0x103356ab match_actual_arg
/home/seurer/gcc/git/gcc-test/gcc/fortran/primary.c:1662
0x1033753f gfc_match_actual_arglist(int, gfc_actual_arglist**, bool)
/home/seurer/gcc/git/gcc-test/gcc/fortran/primary.c:1927
0x1033a2db gfc_match_rvalue(gfc_expr**)
/home/seurer/gcc/git/gcc-test/gcc/fortran/primary.c:3611
0x1030173f match_primary
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:157
0x1030173f match_level_1
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:211
0x1030173f match_mult_operand
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:267
0x10301a73 match_add_operand
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:356
0x10301e73 match_level_2
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:480
And a different one:
0x102b464f gfc_report_diagnostic
/home/seurer/gcc/git/gcc-test/gcc/fortran/error.c:782
0x102b62bf gfc_internal_error(char const*, ...)
/home/seurer/gcc/git/gcc-test/gcc/fortran/error.c:1402
0x1026f357 gfc_divide(gfc_expr*, gfc_expr*)
/home/seurer/gcc/git/gcc-test/gcc/fortran/arith.c:1831
0x10301b07 match_add_operand
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:394
0x10301e73 match_level_2
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:480
0x10302073 match_level_3
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:551
0x1030220f match_level_4
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:599
0x1030220f match_and_operand
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:693
0x10302493 match_or_operand
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:722
0x10302603 match_equiv_operand
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:765
0x10302777 match_level_5
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:811
0x103014ff gfc_match_expr(gfc_expr**)
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:870
0x103356ab match_actual_arg
/home/seurer/gcc/git/gcc-test/gcc/fortran/primary.c:1662
0x1033753f gfc_match_actual_arglist(int, gfc_actual_arglist**, bool)
/home/seurer/gcc/git/gcc-test/gcc/fortran/primary.c:1927
0x1033a2db gfc_match_rvalue(gfc_expr**)
/home/seurer/gcc/git/gcc-test/gcc/fortran/primary.c:3611
0x1030173f match_primary
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:157
0x1030173f match_level_1
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:211
0x1030173f match_mult_operand
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:267
0x10301a73 match_add_operand
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:356
0x10301e73 match_level_2
/home/seurer/gcc/git/gcc-test/gcc/fortran/matchexp.c:480
Author: Harald Anlauf <[email protected]>
Date: Sun May 10 19:46:06 2020 +0200
PR fortran/93499 - ICE on division by zero in declaration statements
Division by zero in declaration statements could sometimes
generate NULL pointers being passed around that lead to ICEs.
2020-05-10 Harald Anlauf <[email protected]>
gcc/fortran/
PR fortran/93499
* arith.c (gfc_divide): Catch division by zero.
(eval_intrinsic_f3): Safeguard for NULL operands.
gcc/testsuite/
PR fortran/93499
* gfortran.dg/pr93499.f90: New test.