[Patch, Fortran] More clean-up with try-finally

Daniel Kraft d@domob.eu
Sun Jul 18 19:28:00 GMT 2010


Hi,

the attached patch takes my last one a step further.  In 
gfc_generate_function_code, there still was some init/clean-up code (for 
instance, for bounds/recursion checking but also other stuff); this is 
now also handled via gfc_wrapped_block and the clean-up done as try-finally.

As a side effect, I now got rid of the "return label" philosophy for 
procedures.  Instead, a RETURN statement actually returns; all follow-up 
code that needs to be executed is done so as part of try-finally.  I 
hope this makes the code structure clearer to the middle-end (and at 
least seems simpler and more intuitive to me).

I've marked two points in the patch with an XXX comment:  First, I 
created a new global variable in trans-decl that keeps track of the 
currently trans'ed procedure's gfc_symbol (instead of its return label). 
  I did not find any existing feature to get it, although I may well 
image there is one.  Did I miss it?

Second, in gfc_trans_return, se.post is added to the code after the exit 
jump -- maybe I did completely misunderstand something, but to me this 
makes no sense (as it will not be executed anyway); I guess that this 
just never really mattered.  But I may be wrong -- so can this line go? 
  And if so, why can we be sure that se.post needs never be handled? 
And if I'm wrong, why?

This patch passed the test-suite, but when I wanted to re-check with a 
fresh svn update, bootstrap failed (since) with

Comparing stages 2 and 3
warning: gcc/cc1-checksum.o differs
Bootstrap comparison failure!
gcc/dwarf2out.o differs
gcc/recog.o differs
gcc/reload.o differs
gcc/i386.o differs
gcc/reg-stack.o differs
libiberty/hashtab.o differs.

I can't image how this is related to my patch; is anyone else seeing 
this, too?

Ok for trunk once I can bootstrap again and there are no regressions?

Daniel

-- 
http://www.pro-vegan.info/
--
Done:  Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.changelog
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100718/bd436ad3/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100718/bd436ad3/attachment-0001.ksh>


More information about the Gcc-patches mailing list