[Patch, Fortran] PR fortran/38883: Fix MVBITS for subcomponent-references

Daniel Kraft d@domob.eu
Mon Jan 26 21:12:00 GMT 2009


Hi all,

this patch fixes PR fortran/38883.  This regression turned up when I 
added correct dependency checking for MVBITS, which results in a 
temporary being created for the test-case (before, wrong-code could 
result).  This temporary is however created with the type of the 
expression to mirror, which is incorrect for subcomponent-references, as 
the real value it is expected to hold is of the real derived-type, while 
the expression's type is only the type of the referenced field.  This 
made gfortran ICE here.

The fix is to create the temporary also of the full derived-type; while 
this is not the "best" way (see the TODO comment) of course, it is quite 
simple and works; another solution could use gfc_conv_subref_array_arg 
but would need to modify the caller of gfc_conv_elemental_dependencies 
as well and may easily get complicated.  Thus I'd go with this patch 
until we really want to optimize this (which seems unnecessary to me, I 
don't think this case happens often).

Regression-testing at the moment on GNU/Linux-x86-32; I hope I got it 
all right, this is not my strongest part of gfortran...  (That's also 
why I introduced the regression, of course ;).)  Ok for trunk if no 
failures?

Yours,
Daniel

PS: I just switched my system from using root for nearly everything (it 
was quite comfortable, though...), and now running the testsuite 
complains about "could not spawn".  Does anybody know what could be 
wrong here?  For now, I'm just running the regtest as root still which 
works flawlessly.

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


More information about the Fortran mailing list