This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, Fortran] More clean-up with try-finally
Paul Richard Thomas wrote:
which doesn't make sense. (Ditto for the old code: The free came after
the "goto __return".) Thus, removing the line does neither harm nor
improve the situation. The real fix is to ensure that the clean up of
"se.post" comes before the "return".
gfc_add_expr_to_block (&se.pre, tmp); /* Add the return
MODIFY_EXPR to the block */
gfc_add_block_to_block (&se.pre, &se.post); /* Follow it with
the post block. */
tmp = gfc_generate_return (); /* and return */
gfc_add_expr_to_block (&se.pre, tmp);
return gfc_finish_block (&se.pre);
You're right (and Tobias also suggested the same), I overlooked that the
return'ed expression can only be a "simple" one and so this works.
I'll add this line and commit (I guess this is obvious) later today.
Thanks for spotting this!
To go: Hea-Kni-Mon-Pri