[Ada] Fix ICE on constant declared as weak

Eric Botcazou ebotcazou@adacore.com
Mon Nov 23 19:40:00 GMT 2009


The ICE occurs when gigi asks the middle-end to declare a CONST_DECL as weak.
Fixed by making it declare the corresponding VAR_DECL as weak instead.

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


2009-11-23  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Pass the list
	of attributes when building the corresponding variable of a constant.
	* gcc-interface/utils.c (create_var_decl_1): Do not process attributes
	for constants.


2009-11-23  Eric Botcazou  <ebotcazou@adacore.com>

        * gnat.dg/specs/weak1.ads: New test.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 1301 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091123/5985474d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: weak1.ads
Type: text/x-adasrc
Size: 146 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091123/5985474d/attachment-0001.bin>


More information about the Gcc-patches mailing list