[Patch, Fortran] PR57697/58469 - Fix another defined-assignment issue

Tobias Burnus burnus@net-b.de
Thu Sep 19 19:11:00 GMT 2013


This patch fixes two issues:

a) It could happen that no code change has happened. In that case, the 
one freed an expression which still should be used.

b) In my previous patch, I used a pointer assignment to the temporary of 
the LHS (after its allocation) [only if the LHS was initially 
unassigned]. That lead to a problem with double deallocation (temporary 
+ LHS). In the previous test case, it didn't matter as the LHS wasn't 
freed (implicit SAVE of in the main program). That's now solved by a 
NULL-pointer assignment.

Finally, I corrected some indenting issues and removed unreachable code.

Build and regtested on x86-64-gnu-linux.
OK for the trunk and the 4.8 branch?

Tobias

PS: For the testcase of (a), I am not quite sure whether the intrinsic 
assignment should invoke the defined assignment. It currently doesn't 
for gfortran and crayftn. In any case, the invalid freeing is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: defined-assignment.diff
Type: text/x-patch
Size: 5276 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130919/70df112d/attachment.bin>


More information about the Fortran mailing list