+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>
* gcc-interface/utils.c (gnat_poplevel): Use block_chainon.
max_size (TYPE_SIZE (gnu_return_type),
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;
}
+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>
PR tree-optimization/48622
+-- { dg-do compile }\r
+\r
package body Discr27 is\r
\r
subtype Index is Positive range 1..4096;\r
--- { dg-do compile }\r
-\r
package Discr27 is\r
\r
procedure Proc;\r
--- /dev/null
+-- { 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;
--- /dev/null
+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;
--- /dev/null
+package Discr28_Pkg is
+
+ function N return Natural;
+
+end Discr28_Pkg;