> cat bug.f90 MODULE qs_integrate_potential_low INTEGER, PARAMETER :: dp = 8 TYPE cell_type REAL(KIND=8) :: h_inv(3,3) END TYPE TYPE(cell_type), POINTER :: cell REAL(KIND=dp), DIMENSION(3) :: rp CONTAINS SUBROUTINE integrate_general_opt() REAL(KIND=dp) :: gp(3) INTEGER :: ng gp=MATMUL(cell%h_inv,rp)*ng END SUBROUTINE integrate_general_opt END MODULE qs_integrate_potential_low with gcc version 6.0.0 20150511 (experimental) [trunk revision 222989] (GCC) > gfortran -O1 bug.f90 f951: internal compiler error: in simplify_bound, at fortran/simplify.c:3467 0x659389 simplify_bound ../../gcc/gcc/fortran/simplify.c:3463 0x5f7fa1 do_simplify ../../gcc/gcc/fortran/intrinsic.c:4149 0x605618 gfc_intrinsic_func_interface(gfc_expr*, int) ../../gcc/gcc/fortran/intrinsic.c:4403 0x5edf62 gfc_simplify_expr(gfc_expr*, int) ../../gcc/gcc/fortran/expr.c:1837 0x708365 get_array_inq_function ../../gcc/gcc/fortran/frontend-passes.c:2018 0x70d5a9 scalarized_expr ../../gcc/gcc/fortran/frontend-passes.c:2657 0x70b8e2 inline_matmul_assign ../../gcc/gcc/fortran/frontend-passes.c:3000 0x70bde9 gfc_code_walker(gfc_code**, int (*)(gfc_code**, int*, void*), int (*)(gfc_expr**, int*, void*), void*) ../../gcc/gcc/fortran/frontend-passes.c:3188 0x70ce6b optimize_namespace ../../gcc/gcc/fortran/frontend-passes.c:989 0x70ce38 optimize_namespace ../../gcc/gcc/fortran/frontend-passes.c:995 0x70cfc3 gfc_run_passes(gfc_namespace*) ../../gcc/gcc/fortran/frontend-passes.c:129 0x637bda gfc_parse_file() ../../gcc/gcc/fortran/parse.c:5477 0x678ef5 gfc_be_parse_file ../../gcc/gcc/fortran/f95-lang.c:228 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.
This is independent of matmul: MODULE qs_integrate_potential_low INTEGER, PARAMETER :: dp = 8 TYPE cell_type REAL(KIND=8) :: h_inv(3,3) END TYPE TYPE(cell_type), POINTER :: cell REAL(KIND=dp), DIMENSION(3) :: rp CONTAINS SUBROUTINE integrate_general_opt() REAL(KIND=dp) :: gp(3) INTEGER :: ng print *,lbound(cell%h_inv) END SUBROUTINE integrate_general_opt END MODULE qs_integrate_potential_low This is an assert introduced in r222979. Removing the assert makes the code work, at least superficially (it will print out 1,1). Mikael?
Author: mikael Date: Mon May 11 21:03:50 2015 New Revision: 223019 URL: https://gcc.gnu.org/viewcvs?rev=223019&root=gcc&view=rev Log: Fix fortran/66100 bound simplification ICE PR fortran/66100 gcc/fortran/ * simplify.c (simplify_bound): Fix assert to accept subobject * arrays. gcc/testsuite/ * gfortran.dg/bound_simplification_6.f90: New. Added: trunk/gcc/testsuite/gfortran.dg/bound_simplification_6.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/simplify.c trunk/gcc/testsuite/ChangeLog
This should be fixed.