https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99169

--- Comment #3 from anlauf at gcc dot gnu.org ---
A conservative solution simply disables the clobber:

diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 103cb31c664..ce7bfaa89e8 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -6082,6 +6084,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
                        /* FIXME - PR 87395 and PR 41453  */
                        && e->symtree->n.sym->attr.save == SAVE_NONE
                        && !e->symtree->n.sym->attr.associate_var
+                       && !e->symtree->n.sym->attr.allocatable
                        && e->ts.type != BT_CHARACTER && e->ts.type !=
BT_DERIVED
                        && e->ts.type != BT_CLASS && !sym->attr.elemental;

This should result only in a missed optimization.
Is there a way to get sth. like:

  *i = {CLOBBER};

so that we do not clobber the pointer but the pointer to?

Reply via email to