Commit 51c5169c by Eric Botcazou Committed by Eric Botcazou

decl.c (gnat_to_gnu_entity): Declare the padded type built for the return type…

decl.c (gnat_to_gnu_entity): Declare the padded type built for the return type if it is unconstrained.

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Function>: Declare the
	padded type built for the return type if it is unconstrained.

From-SVN: r172608
parent 54333b7c
2011-04-17 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Function>: Declare the
padded type built for the return type if it is unconstrained.
2011-04-14 Nathan Froyd <froydnj@codesourcery.com> 2011-04-14 Nathan Froyd <froydnj@codesourcery.com>
* gcc-interface/utils.c (gnat_poplevel): Use block_chainon. * gcc-interface/utils.c (gnat_poplevel): Use block_chainon.
......
...@@ -4068,6 +4068,13 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -4068,6 +4068,13 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
max_size (TYPE_SIZE (gnu_return_type), max_size (TYPE_SIZE (gnu_return_type),
true), true),
0, gnat_entity, false, false, false, true); 0, gnat_entity, false, false, false, true);
/* Declare it now since it will never be declared otherwise.
This is necessary to ensure that its subtrees are properly
marked. */
create_type_decl (TYPE_NAME (gnu_return_type), gnu_return_type,
NULL, true, debug_info_p, gnat_entity);
return_by_invisi_ref_p = true; return_by_invisi_ref_p = true;
} }
......
2011-04-17 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/discr27.ad[sb]: Move dg directive.
* gnat.dg/discr28.ad[sb]: New test.
* gnat.dg/discr28_pkg.ads: New helper.
2011-04-17 Michael Matz <matz@suse.de> 2011-04-17 Michael Matz <matz@suse.de>
PR tree-optimization/48622 PR tree-optimization/48622
......
-- { dg-do compile }
package body Discr27 is package body Discr27 is
subtype Index is Positive range 1..4096; subtype Index is Positive range 1..4096;
......
-- { dg-do compile }
package Discr27 is package Discr27 is
procedure Proc; procedure Proc;
......
-- { dg-do compile }
package body Discr28 is
procedure Dummy (E : Rec) is
begin
null;
end;
function F return Rec is
begin
return Default_Rec;
end;
procedure Proc1 is
begin
Dummy (F);
end;
procedure Proc2 is
begin
Dummy (F);
end;
end Discr28;
with Discr28_Pkg;
package Discr28 is
type Enum is (One, Two);
type Rec (D : Enum := One) is record
case D is
when One => null;
when Two => S : String (1 .. Discr28_Pkg.N);
end case;
end record;
Default_Rec : constant Rec := (D => One);
procedure Proc1;
procedure Proc2;
end Discr28;
package Discr28_Pkg is
function N return Natural;
end Discr28_Pkg;
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