[Bug fortran/124652] passing a procedure pointer to c_funloc gives incorrect result
anlauf at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Mar 31 21:02:39 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124652
--- Comment #8 from anlauf at gcc dot gnu.org ---
(In reply to anlauf from comment #7)
> Is the CLOBBER correct?
Disabling it with the following patch fixes the ICE:
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index d5254be007d..6d411040042 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -7549,6 +7549,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
&& !e->ts.u.derived->attr.alloc_comp
&& !e->ts.u.derived->attr.pdt_type
&& !gfc_is_finalizable (e->ts.u.derived,
NULL)))
+ && e->ts.type != BT_PROCEDURE
&& !sym->attr.elemental)
{
tree var;
More information about the Gcc-bugs
mailing list