Commit c9d84d0e by Eric Botcazou Committed by Eric Botcazou

decl.c (gnat_to_gnu_entity): Also use return-by-invisible-reference if the…

decl.c (gnat_to_gnu_entity): Also use return-by-invisible-reference if the return type is By_Reference.

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>: Also
	use return-by-invisible-reference if the return type is By_Reference.
	Tidy up and skip the processing of the return type if it is void.

From-SVN: r166916
parent 69ecd18f
2010-11-18 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>: Also
use return-by-invisible-reference if the return type is By_Reference.
Tidy up and skip the processing of the return type if it is void.
2010-11-17 Joseph Myers <joseph@codesourcery.com> 2010-11-17 Joseph Myers <joseph@codesourcery.com>
* gcc-interface/misc.c (gnat_parse_file): Take no arguments. * gcc-interface/misc.c (gnat_parse_file): Take no arguments.
......
2010-11-18 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/atomic4.ad[sb]: New test.
* gnat.dg/volatile4.adb: Likewise.
2010-11-18 Richard Henderson <rth@redhat.com> 2010-11-18 Richard Henderson <rth@redhat.com>
* gcc.target/i386/pr46470.c: Skip for 32-bit PIC. * gcc.target/i386/pr46470.c: Skip for 32-bit PIC.
......
-- { dg-do compile }
-- { dg-options "-O -gnatn" }
package body Atomic4 is
procedure Next (Self : in out Reader'Class) is
begin
Self.Current_Reference := Self.Reference_Stack.Last_Element;
Self.Reference_Stack.Delete_Last;
end Next;
end Atomic4;
with Ada.Containers.Vectors;
package Atomic4 is
type String is limited null record;
type String_Access is access all String;
pragma Atomic (String_Access);
type Reference is record
Text : String_Access;
end record;
package Reference_Vectors is
new Ada.Containers.Vectors (Natural, Reference);
type Reader is tagged limited record
Current_Reference : Reference;
Reference_Stack : Reference_Vectors.Vector;
end record;
procedure Next (Self : in out Reader'Class);
end Atomic4;
-- { dg-do run }
procedure Volatile4 is
type My_Int is new Integer;
pragma Volatile (My_Int);
type Rec is record
I : My_Int;
end record;
function F (R : Rec) return Rec is
begin
return R;
end;
R : Rec := (I => 0);
begin
R := F (R);
if R.I /= 0 then
raise Program_Error;
end if;
end;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment