Commit a3628196 by Eric Botcazou Committed by Eric Botcazou

gimple-fold.c (canonicalize_constructor_val): Strip only useless type conversions.

	* gimple-fold.c (canonicalize_constructor_val): Strip only useless type
	conversions.

From-SVN: r189685
parent b42ff0a5
2012-07-19 Eric Botcazou <ebotcazou@adacore.com>
* gimple-fold.c (canonicalize_constructor_val): Strip only useless type
conversions.
2012-07-19 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/53942
......
......@@ -139,7 +139,7 @@ can_refer_decl_in_current_unit_p (tree decl, tree from_decl)
tree
canonicalize_constructor_val (tree cval, tree from_decl)
{
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.
......
-- { dg-do compile }
package body Aggr20 is
procedure Proc (R : out Rec3) is
begin
R := (Callback => Nil_Rec2);
end;
end Aggr20;
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;
with System;
package Aggr20_Pkg is
procedure Proc;
Default_Nil_Address : constant System.Address := Proc'Address;
end Aggr20_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