trans.c (Subprogram_Body_to_gnu): Pop the stack of return variables for subprograms using the CICO mechanism.

* gcc-interface/trans.c (Subprogram_Body_to_gnu): Pop the stack of
	return variables for subprograms using the CICO mechanism.

From-SVN: r202686
This commit is contained in:
Eric Botcazou 2013-09-18 10:25:44 +00:00 committed by Eric Botcazou
parent dae47c5069
commit 01e552339c
4 changed files with 41 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2013-09-18 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Subprogram_Body_to_gnu): Pop the stack of
return variables for subprograms using the CICO mechanism.
2013-08-13 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (can_equal_min_or_max_val_p): Be prepared for

View File

@ -3438,6 +3438,8 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
{
tree gnu_retval;
VEC_pop (tree, gnu_return_var_stack);
add_stmt (gnu_result);
add_stmt (build1 (LABEL_EXPR, void_type_node,
VEC_last (tree, gnu_return_label_stack)));

View File

@ -1,3 +1,7 @@
2013-09-18 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/in_out_parameter4.adb: New test.
2013-08-13 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/loop_optimization16.adb: New test.

View File

@ -0,0 +1,30 @@
-- { dg-do run }
-- { dg-options "-gnat12 -gnatVa" }
procedure In_Out_Parameter4 is
type Enum is (E_Undetermined, E_Down, E_Up);
subtype Status_T is Enum range E_Down .. E_Up;
function Recurse (Val : in out Integer) return Status_T is
Result : Status_T;
procedure Dummy (I : in out Integer) is begin null; end;
begin
if Val > 500 then
Val := Val - 1;
Result := Recurse (Val);
return Result;
else
return E_UP;
end if;
end;
Val : Integer := 501;
S : Status_T;
begin
S := Recurse (Val);
end;