Commit 39791fb6 by Eric Botcazou Committed by Eric Botcazou

cgraphunit.c (cgraph_node::expand_thunk): When expanding a GIMPLE thunk that…

cgraphunit.c (cgraph_node::expand_thunk): When expanding a GIMPLE thunk that returns by reference...

	* cgraphunit.c (cgraph_node::expand_thunk): When expanding a GIMPLE
	thunk that returns by reference, use the type of the return object
	of the thunk instead of that of the alias to build the dereference.

From-SVN: r268182
parent b3e5901b
2019-01-23 Eric Botcazou <ebotcazou@adacore.com>
* cgraphunit.c (cgraph_node::expand_thunk): When expanding a GIMPLE
thunk that returns by reference, use the type of the return object
of the thunk instead of that of the alias to build the dereference.
2019-01-23 Vineet Gupta <vgupta@synopsys.com> 2019-01-23 Vineet Gupta <vgupta@synopsys.com>
* config/arc/atomic.md: Add operand to DMB instruction. * config/arc/atomic.md: Add operand to DMB instruction.
......
...@@ -1916,10 +1916,9 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) ...@@ -1916,10 +1916,9 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
restmp = gimple_fold_indirect_ref (resdecl); restmp = gimple_fold_indirect_ref (resdecl);
if (!restmp) if (!restmp)
restmp = build2 (MEM_REF, restmp = build2 (MEM_REF,
TREE_TYPE (TREE_TYPE (DECL_RESULT (alias))), TREE_TYPE (TREE_TYPE (resdecl)),
resdecl, resdecl,
build_int_cst (TREE_TYPE build_int_cst (TREE_TYPE (resdecl), 0));
(DECL_RESULT (alias)), 0));
} }
else if (!is_gimple_reg_type (restype)) else if (!is_gimple_reg_type (restype))
{ {
......
2019-01-23 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/opt4.ads: New test.
2019-01-23 Jakub Jelinek <jakub@redhat.com> 2019-01-23 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/88964 PR tree-optimization/88964
......
-- { dg-do compile }
-- { dg-options "-O" }
package Opt4 is
type Rec (D : Boolean := False) is record
case D is
when False => null;
when True => I : Integer;
end case;
end record;
Null_Rec : constant Rec := (D => False);
type I1 is limited interface;
type I2 is limited interface;
function Func (Data : I2) return Rec is abstract;
type Ext is limited new I1 and I2 with null record;
overriding function Func (Data : Ext) return Rec is (Null_Rec);
end Opt4;
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