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

--- Comment #27 from anlauf at gcc dot gnu.org ---
(In reply to Mikael Morin from comment #26)
> (In reply to anlauf from comment #25)
> > (In reply to Mikael Morin from comment #24)
> > > (In reply to anlauf from comment #22)
> > > > 
> > > > The remaining problem from PR41453#c8 is the following code in 
> > > > trans-expr.cc:
> > > > 
> > > > (gdb) l 9539,9548
> > > > 9539          else if (add_clobber && expr->ref == NULL)
> > > > 9540            {
> > > > 9541              tree clobber;
> > > > 9542              tree var;
> > > > 9543              /* FIXME: This fails if var is passed by reference, 
> > > > see PR
> > > > 9544                 41453.  */
> > > > 9545              var = expr->symtree->n.sym->backend_decl;
> > > > 9546              clobber = build_clobber (TREE_TYPE (var));
> > > > 9547              gfc_add_modify (&se->pre, var, clobber);
> > > > 9548            }
> > > > 
> > > > One needs to understand how to fix up 'var' here for the case at hand.
> > > > 
> > > I guess the obvious one (se->expr) doesn’t work?
> > 
> > Could you explain how to use it?  (I don't have the necessary vision.)
> 
> Upon return from gfc_conv_expr, se->expr holds the value of the expression.
> So basically var = se->expr;
> As we manage to pass __result_derfc as argument, then I expect se->expr to
> have value __result_derfc at that point.

I tried that - just rechecked - and get an ICE: gimplification failed.
So there's some magic missing I don't see...

Reply via email to