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

--- Comment #8 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 
---
(In reply to Mikael Morin from comment #7)
> (In reply to Joost VandeVondele from comment #6)
> > (In reply to Mikael Morin from comment #5)
> > > (In reply to Joost VandeVondele from comment #4)
> > > > In the original post I suggested that I already looked at the code,
> > > 
> > > What changes did you try?
> > 
> > Baby steps :-) see below. Basically stuck when I realized that somehow the
> > 'tree size' needs to get in.
> > 
> I guess the easiest is to use a variadic call.
> The calls can be updated by incrementing the argument count of
> build_call_expr_loc, and adding the size argument.
> Then you can't use os_error, which is non-variadic.
> You can either use one of the existing (variadic) routines, such as
> runtime_error, or create some os_error_varargs (basically create the
> gfor_fndecl_XXX in trans-decl.c and use it as argument of
> build_call_expr_loc).
> If you create a new declaration, you'll have to write the corresponding code
> in libgfortran.
> 
> Does it sound like it's worth it?

well, at least I have an idea of a way forward.. I did spent a few hours on
this already. I guess it is easier once one knows the code.

I do believe this is useful indeed, within our project we discussed if we could
clean up the error checking of (de)allocates (14000 calls) and we already
removed all checking for all but 400, cleaning away roughly 30000 lines of
(useless in my opinion, and with various bugs) code. See for example
https://sourceforge.net/p/cp2k/code/15938/ with many similar commits. The
remaining 400 calls report the size of the failed allocate. To clean those the
consensus was that the compiler should report the size of the failed
allocation.

Reply via email to