This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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


On Sat, Jun 04, 2005 at 03:45:10PM -0700, Steve Kargl wrote:
> On Sun, Jun 05, 2005 at 12:29:56AM +0200, Tobias Schl?ter wrote:
>>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.
>> 
> 
> Yes, I think your suggestion would work.  Unfortunately, I don't
> know how to implement this. :(

See attached patch (for a fun exercise in hacking).
Bootstrapped and regression tested on i386-*-freebsd.
ChangeLog entries for patch and test case are the
same as in the first email of the thread.

-- 
Steve

Attachment: pr21375.diff
Description: Text document

Attachment: pr21375.f90
Description: Text document


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