This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] Allocate + CAF library


Daniel Carrera wrote:
I propose this:


if (!gfc_array_allocate (&se, expr, stat, errmsg, errlen)) { ... allocate scalar ... } if (code->expr1) { /* The coarray library already sets the errmsg. */ if (gfc_option.coarray == GFC_FCOARRAY_LIB && gfc_expr_attr (expr).codimension) tmp = build1_v (GOTO_EXPR, label_finish); else tmp = build1_v (GOTO_EXPR, label_errmsg); ... }

Yes, that was what I was thinking of. I hadn't checked whether one could use exactly the same code or needed a slightly different version, but it seems as if one can do just as you have written.


[Other PR]
I think I even remember noticing that the code deallocated the previous array and was wondering why it did that.

I think I saw the code also before in some dump, wondered about it, but not enough to check the standard, which explicitly prohibits the (de/re)allocation. (It does so in F2003 and F2008, I have not checked the wording in F90/F95. Maybe the status back then was "undefined"?)


Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]