[Patch, Fortran] PR 51809 Fix ICE with __vtab

Tobias Burnus burnus@net-b.de
Mon Jan 16 17:54:00 GMT 2012


Dear all,

current gfortran uses FL_PARAMETER for _vtab and _init_def; 
unfortunately, that will fail sometimes to properly read the symbols; in 
the PR _vtab->_extension's symbol is not properly read, depending on the 
USE statement order.

I tried to debug it, but I was not very successful. In principle, the 
fixup mechanism should work. On the other hand, the internally generated 
code is not valid: _vtab is a variable of a derived type with pointer 
components (so far so good).

However, Fortran does not allow one to mark such a variable as 
PARAMETER. The main reason is that one could use TRANSFER on the 
parameter - and TRANSFER is back to a pointer somewhere else. That's 
only possible if the value is known at compilation time. However, 
pointer addresses are only known at run time. That does not rule out 
that one uses a PARAMETER internally, but it reduces the incentive to 
debug the issue as it can only affect __vtab/__def_init.

Thus, I decided to backout the patch Rev. 181199 (cf. PR, comment 1) - 
and implement a simple TREE_READONLY in trans-decl.c.

Build and regtested on x86-64-linux.
OK for the 4.7 trunk?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtab-use.diff
Type: text/x-patch
Size: 4326 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120116/8fbfbfc0/attachment.bin>


More information about the Gcc-patches mailing list