[Ada] Fix link error on conditional expression

Eric Botcazou ebotcazou@adacore.com
Mon Jun 11 08:35:00 GMT 2012


The executable cannot be linked because of a duplicated symbol in the object 
files, which comes from a conditional expression used to initialize a constant 
that is the upper bound of an index type in an array.

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


2012-06-11  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity): Do not specifically deal
	with external constants wrt force_global here...
	<E_Constant>: ...but here instead.
	* gcc-interface/utils.c (gnat_pushdecl): Do not put external DECLs onto
	the list of global DECLs.


2012-06-11  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/constant4.adb: New test.
	* gnat.dg/constant4_pkg.ads: New helper.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 2472 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120611/1817fb6a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: constant4.adb
Type: text/x-adasrc
Size: 211 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120611/1817fb6a/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: constant4_pkg.ads
Type: text/x-adasrc
Size: 440 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120611/1817fb6a/attachment-0002.bin>


More information about the Gcc-patches mailing list