diff options
author | Harald Anlauf <anlauf@gmx.de> | 2021-06-04 19:23:48 +0200 |
---|---|---|
committer | Harald Anlauf <anlauf@gmx.de> | 2021-06-04 19:23:48 +0200 |
commit | bee8619ad0ac3bd27b7c8dc5819b83a5e8e147a0 (patch) | |
tree | 7a774e4857347f6c68b0ef4e8b81a22dd4c0c3b0 /gcc/fortran/frontend-passes.c | |
parent | 5328cad24f7460a39b2def12bb9b62be36c92a54 (diff) | |
download | gcc-bee8619ad0ac3bd27b7c8dc5819b83a5e8e147a0.zip gcc-bee8619ad0ac3bd27b7c8dc5819b83a5e8e147a0.tar.gz gcc-bee8619ad0ac3bd27b7c8dc5819b83a5e8e147a0.tar.bz2 |
Fortran - ICE in inline_matmul_assign
Restrict inlining of matmul to those cases where assignment to the
result array does not need special treatment.
gcc/fortran/ChangeLog:
PR fortran/99839
* frontend-passes.c (inline_matmul_assign): Do not inline matmul
if the assignment to the resulting array if it is not of canonical
type (real/integer/complex/logical).
gcc/testsuite/ChangeLog:
PR fortran/99839
* gfortran.dg/inline_matmul_25.f90: New test.
Diffstat (limited to 'gcc/fortran/frontend-passes.c')
-rw-r--r-- | gcc/fortran/frontend-passes.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c index 34fb22c..72a4e04 100644 --- a/gcc/fortran/frontend-passes.c +++ b/gcc/fortran/frontend-passes.c @@ -4193,6 +4193,19 @@ inline_matmul_assign (gfc_code **c, int *walk_subtrees, if (m_case == none) return 0; + /* We only handle assignment to numeric or logical variables. */ + switch(expr1->ts.type) + { + case BT_INTEGER: + case BT_LOGICAL: + case BT_REAL: + case BT_COMPLEX: + break; + + default: + return 0; + } + ns = insert_block (); /* Assign the type of the zero expression for initializing the resulting |