diff options
author | José Rui Faustino de Sousa <jrfsousa@gmail.com> | 2022-09-04 21:53:09 +0200 |
---|---|---|
committer | Harald Anlauf <anlauf@gmx.de> | 2022-09-04 21:55:15 +0200 |
commit | 20d30e737ad79dc36817e59f1676aa8bc0c6b325 (patch) | |
tree | fd904989ef6a32842c1f51c4d2e4cf47f3477287 /gcc/fortran | |
parent | 8b633b42af4ef82baf424ac5021d996a909f398c (diff) | |
download | gcc-20d30e737ad79dc36817e59f1676aa8bc0c6b325.zip gcc-20d30e737ad79dc36817e59f1676aa8bc0c6b325.tar.gz gcc-20d30e737ad79dc36817e59f1676aa8bc0c6b325.tar.bz2 |
Fortran: Fix ICE with -fcheck=pointer [PR100136]
gcc/fortran/ChangeLog:
PR fortran/100136
* trans-expr.cc (gfc_conv_procedure_call): Add handling of pointer
expressions.
gcc/testsuite/ChangeLog:
PR fortran/100136
* gfortran.dg/PR100136.f90: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/trans-expr.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc index 13c3e7d..7895d03 100644 --- a/gcc/fortran/trans-expr.cc +++ b/gcc/fortran/trans-expr.cc @@ -7220,16 +7220,15 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, else goto end_pointer_check; + tmp = parmse.expr; if (fsym && fsym->ts.type == BT_CLASS) { - tmp = build_fold_indirect_ref_loc (input_location, - parmse.expr); + if (POINTER_TYPE_P (TREE_TYPE (tmp))) + tmp = build_fold_indirect_ref_loc (input_location, tmp); tmp = gfc_class_data_get (tmp); if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (tmp))) tmp = gfc_conv_descriptor_data_get (tmp); } - else - tmp = parmse.expr; /* If the argument is passed by value, we need to strip the INDIRECT_REF. */ |