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] Fix fortran/25031, multiple allocations


Steve Kargl wrote:
I completely agree with the quality-of-implementation concept.
Unfortunately, the Standard is vague.  If STAT= is present
and an error condition occurs the "allocate-object will have
a processor-dependent status".  Then later in the same paragraph,
we find "each allocate-object that was not successfully allocated
shall retain its previous allocation status ...".  I could be wrong,
but this simply means ALLOCATED(x) will be .true. and we have
either x(4) or x(3). :(

That agrees with my assessment. I'm not sure this merits a frown, however; it just means that whichever solution is simplest is standard-compliant. In particular, the submitted patch (if I understand it correctly) should leave the allocation untouched in this case, which is compliant.


It might be worth throwing an "if (.NOT. ALLOCATED(a)) call abort" into the testcase after the second allocation just to verify this, though.

- Brooks


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