+2012-07-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gimple-fold.c (canonicalize_constructor_val): Strip only useless type
+ conversions.
+
2012-07-19 Richard Guenther <rguenther@suse.de>
Eric Botcazou <ebotcazou@adacore.com>
tree
canonicalize_constructor_val (tree cval)
{
- STRIP_NOPS (cval);
+ STRIP_USELESS_TYPE_CONVERSION (cval);
if (TREE_CODE (cval) == POINTER_PLUS_EXPR
&& TREE_CODE (TREE_OPERAND (cval, 1)) == INTEGER_CST)
{
2012-07-19 Eric Botcazou <ebotcazou@adacore.com>
+ * gnat.dg/aggr20.ad[sb]: New test.
+ * gnat.dg/aggr20_pkg.ads: New helper.
+
+2012-07-19 Eric Botcazou <ebotcazou@adacore.com>
+
* gnat.dg/derived_type3.adb: New test.
* gnat.dg/derived_type3_pkg.ad[sb]: New helper.
--- /dev/null
+-- { dg-do compile }
+
+package body Aggr20 is
+
+ procedure Proc (R : out Rec3) is
+ begin
+ R := (Callback => Nil_Rec2);
+ end;
+
+end Aggr20;
--- /dev/null
+with Aggr20_Pkg; use Aggr20_Pkg;
+with System;
+
+package Aggr20 is
+
+ type Rec1 is record
+ Address : System.Address;
+ end record;
+
+ Nil_Rec1 : constant Rec1 := (Address => Default_Nil_Address);
+
+ type Rec2 is record
+ Callback : Rec1;
+ end record;
+
+ Nil_Rec2 : constant Rec2 := (Callback => Nil_Rec1);
+
+ type Rec3 is record
+ Callback : Rec2;
+ end record;
+
+ procedure Proc (R : out Rec3);
+
+end Aggr20;
--- /dev/null
+with System;
+
+package Aggr20_Pkg is
+
+ procedure Proc;
+
+ Default_Nil_Address : constant System.Address := Proc'Address;
+
+end Aggr20_Pkg;