From patchwork Tue Jan 22 10:04:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Ada] Patchlet for N_Expression_With_Actions Date: Tue, 22 Jan 2013 00:04:40 -0000 From: Eric Botcazou X-Patchwork-Id: 214484 Message-Id: <97064970.OM6mV8udCa@polaris> To: gcc-patches@gcc.gnu.org This is a patchlet to fix a (potential) regression introduced by the use of N_Expression_With_Actions in some constructs. Tested on x86_64-suse-linux, applied on the mainline. 2013-01-22 Eric Botcazou * gcc-interface/trans.c (gnat_to_gnu) : Do not translate the Etype of the node before translating the Actions. Index: gcc-interface/trans.c =================================================================== --- gcc-interface/trans.c (revision 195366) +++ gcc-interface/trans.c (working copy) @@ -6810,7 +6810,6 @@ gnat_to_gnu (Node_Id gnat_node) /****************/ case N_Expression_With_Actions: - gnu_result_type = get_unpadded_type (Etype (gnat_node)); /* This construct doesn't define a scope so we don't wrap the statement list in a BIND_EXPR; however, we wrap it in a SAVE_EXPR to protect it from unsharing. */ @@ -6820,6 +6819,7 @@ gnat_to_gnu (Node_Id gnat_node) gnu_expr = gnat_to_gnu (Expression (gnat_node)); gnu_result = build_compound_expr (TREE_TYPE (gnu_expr), gnu_result, gnu_expr); + gnu_result_type = get_unpadded_type (Etype (gnat_node)); break; case N_Freeze_Entity: