This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/11090] Variant Record Initialization.
- From: "bdavis9659 at comcast dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Sep 2003 16:51:15 -0000
- Subject: [Bug ada/11090] Variant Record Initialization.
- References: <20030604184644.11090.bdavis9659@comcast.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11090
------- Additional Comments From bdavis9659 at comcast dot net 2003-09-13 16:51 -------
Below is a patch that resolves this problem:
Index: gcc/gcc/ada/trans.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/ada/trans.c,v
retrieving revision 1.30
diff -c -3 -p -r1.30 trans.c
*** gcc/gcc/ada/trans.c 7 Jul 2003 17:57:27 -0000 1.30
--- gcc/gcc/ada/trans.c 13 Sep 2003 16:24:28 -0000
*************** assoc_to_constructor (gnat_assoc, gnu_ty
*** 4946,4952 ****
if (Do_Range_Check (Expression (gnat_assoc)))
gnu_expr = emit_range_check (gnu_expr, Etype (gnat_field));
! gnu_expr = convert (TREE_TYPE (gnu_field), gnu_expr);
/* Add the field and expression to the list. */
gnu_list = tree_cons (gnu_field, gnu_expr, gnu_list);
--- 4946,4952 ----
if (Do_Range_Check (Expression (gnat_assoc)))
gnu_expr = emit_range_check (gnu_expr, Etype (gnat_field));
! gnu_expr = convert (TREE_TYPE (gnu_field), protect_multiple_eval
(gnu_expr));
/* Add the field and expression to the list. */
gnu_list = tree_cons (gnu_field, gnu_expr, gnu_list);