This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gnat] -- patch for PR 11090 (Variant Record Initialization)
- From: bud davis <bdavis9659 at comcast dot net>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 13 Sep 2003 20:25:50 -0500
- Subject: [gnat] -- patch for PR 11090 (Variant Record Initialization)
Below patch corrects problem described in PR 11090.
"acats4gnat" (from http://perso.wanadoo.fr/guerby/)
has no additional failures caused by this patch.
no testcase provided (ada appears to have none). the example
program provided with the PR does give the correct output.
"make bootstrap" runs to completion on i686-pc-linux-gnu.
regards,
bud davis
bdavis9659@comcast.net
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);