[patch] Implement sizeof intrinsic, a minor cleanups to trans-intrinsic.c

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Mon May 28 17:37:00 GMT 2007


the attached patch implements the SIZEOF intrinsic.  Since the code for 
determining the length is copied from the code for TRANSFER, I had a 
chance to look at that as well and noticed the complete lack of 
constant-folding in it as well as a redundant initialization, which I 
chose to fix.  The code could also be somewhat simplified, as I did in 
the version for SIZEOF, but for fear of introducing bugs, I didn't touch 
it.  I tried to avoid the redundancy between the two size-determination 
codes by merging them, but failed at doing so: I would have had to walk 
the expression twice in gfc_conv_intrinsic_array_transfer, which 
wouldn't have left me with much saved code.

The patch comes with a new testcase which exercises the stuff that 
should be platform independent.  Built and tested on i386-darwin.  I 
also checked make pdf.  Ok?

- Tobi
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sizeof_final.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070528/79433409/attachment.txt>

More information about the Gcc-patches mailing list