[Ada] Fix LTO warning with tagged types

Eric Botcazou ebotcazou@adacore.com
Sat May 8 11:50:00 GMT 2010


Static dispatch tables use a trick to break up circularity problems: first 
they are declared as imported constants then defined as exported constants.
This leads to problems with type merging in LTO mode because a specific 
subtype is used in each case.

Tested on i586-suse-linux, applied on the mainline.


2010-05-08  Eric Botcazou  <ebotcazou@adacore.com>

	* exp_disp.adb (Make_Tags): Mark the imported view of dispatch tables.
	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Make imported
	constants really constant.
	<E_Record_Subtype>: Strip the suffix for dispatch table entities.


2010-05-08  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/lto5.adb: New test.
	* gnat.dg/lto5_pkg.ad[sb]: New helper.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 2408 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100508/87a61633/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lto5.adb
Type: text/x-adasrc
Size: 98 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100508/87a61633/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lto5_pkg.ads
Type: text/x-adasrc
Size: 108 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100508/87a61633/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lto5_pkg.adb
Type: text/x-adasrc
Size: 85 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100508/87a61633/attachment-0003.bin>


More information about the Gcc-patches mailing list