[fortran,patch] Fix a few ICEs with -ff2c (PR 34868)

FX Coudert fxcoudert@gmail.com
Thu Feb 28 14:37:00 GMT 2008


Attached patch fixes two ICE on valid code when -ff2c is used. The  
way gfortran extends f2c calling conventions is that, whenever a  
procedure requires an explicit interface (such as assumed-shape  
arrays), we fall back to our usual calling conventions. That is a  
good choice, and probably the best compromise. The original ICE in  
the PR comes from the fact that, at some point in trans-expr.c, we  
forgot to check the symbol's attr.always_explicit; the patch adds  
that. However, when writing the testcase to submit my patch, I  
discovered that this isn't enough for functions that use the "result"  
syntax ("function foo() result(bar)"); that's because the symbol for  
the result is not marked with attr.always_explicit, only the symbole  
for the procedure. Seeing no reason not to, and because it's much  
easier, I've changed the code so that we set now mark both symbols.

Patch was bootstrapped and regtested on x86_64-linux (both -m32 and - 
m64), comes with a testcase. OK to commit?

FX


-- 
François-Xavier Coudert
http://www.homepages.ucl.ac.uk/~uccafco/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr34868.ChangeLog
Type: application/octet-stream
Size: 426 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080228/260e2fb3/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr34868.diff
Type: application/octet-stream
Size: 4377 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080228/260e2fb3/attachment-0001.obj>


More information about the Fortran mailing list