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: r202684
This commit is contained in:
Eric Botcazou 2013-09-18 10:21:37 +00:00 committed by Eric Botcazou
parent 995a1b4a75
commit df2abf5469
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-09-13 Dominique Dhumieres <dominiq@lps.ens.fr>
* gcc-interface/Makefile.in: Fix darwin Filter to match on $target_os,

View File

@ -3605,6 +3605,8 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
{
tree gnu_retval;
gnu_return_var_stack->pop ();
add_stmt (gnu_result);
add_stmt (build1 (LABEL_EXPR, void_type_node,
gnu_return_label_stack->last ()));

View File

@ -1,3 +1,7 @@
2013-09-18 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/in_out_parameter4.adb: New test.
2013-09-18 Marek Polacek <polacek@redhat.com>
PR sanitizer/58411

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;