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 for PR fortran/21375


Steve Kargl wrote:
> You're right about the DEALLOCATE(a1,a2,stat=i) case above.  Unfortunately,
> I don't know how to fix this.  I assume that inside the for loop of
> gfc_trans_deallocate(), I need to check if pstat is set to 1 on each
> iteration and if so set a have_seen_problem flag.  Once the for loop
> exits, then check have_seen_problem and reset pstat with an appropriate
> value.  Any help would be appreciate (in that I don't understand the
> trans-*) file too well.

Since the stat variable is defined to be zero for success, and non-zero
otherwise, I think we could just set the user-supplied variable to zero before
we call deallocate, and then simply add the result to the user variable
instead of assigning it, effectively making the stat variable count the
unsuccessfull deallocations.

- Tobi


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