[Bug fortran/58786] module function with passed character array of explicit length causes an ICE
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Oct 13 22:06:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58786
--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Jürgen Reuter from comment #2)
> Tobias, after your fix as of today on PR58787, is that original issue also
> fixed?
No, I only moved things around to avoid crashing after an error occurred.
Regarding comment 1, I think gimplfier doesn't like:
val.1 = (integer(kind=4)) _gfortran_string_len_trim (1, &(*ifm.0)[S.2 + -1]) +
val.1;
Namely, it has issues with:
(*ifm.0)[S.2 + -1]
The failing code is:
tree elmt_size = unshare_expr (array_ref_element_size (t));
which has the value NULL_TREE. Here, "t" is the code above with
character(kind=1)[1][1:1] * D.3780;
character(kind=1)[1][1:] * restrict ifm.0;
ifm.0 = (character(kind=1)[1][1:] * restrict) D.3780;
If one moves the function into the module, "elmt_size" is the integer constant
"1" instead of NULL_TREE.
Comparing the type, the failing case (separate subroutine) has
string-flag BLK
while the working case (module subroutine) has
string-flag QI size <integer_cst 0x7ffff6960c60 8> unit-size <integer_cst
0x7ffff6960c78 1>
More information about the Gcc-bugs
mailing list