Commit 1878be32 by Eric Botcazou Committed by Eric Botcazou

decl.c (gnat_to_gnu_entity): Always mark the expression of a renaming manually in case #3.

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Always mark
	the expression of a renaming manually in case #3.

From-SVN: r234018
parent 51b36161
2016-03-07 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Always mark
the expression of a renaming manually in case #3.
2016-03-02 Dominik Vogt <vogt@linux.vnet.ibm.com>
* system-linux-s390.adsx: Enable Stack_Check_Probes.
......
......@@ -1058,12 +1058,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
= elaborate_reference (gnu_expr, gnat_entity, definition,
&init);
/* If we are not defining the entity, the expression will not
be attached through DECL_INITIAL so it needs to be marked
manually because it will likely be shared. Likewise for a
dereference as it will be folded by the ADDR_EXPR below. */
if ((!definition || TREE_CODE (renamed_obj) == INDIRECT_REF)
&& global_bindings_p ())
/* The expression needs to be marked manually because it will
likely be shared, even for a definition since the ADDR_EXPR
built below can cause the first few nodes to be folded. */
if (global_bindings_p ())
MARK_VISITED (renamed_obj);
if (type_annotate_only
......
2016-03-07 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/renaming9.ad[sb]: New testcase.
2016-03-05 Jakub Jelinek <jakub@redhat.com>
PR c++/70084
......
-- { dg-do compile }
package body Renaming9 is
procedure Proc is
begin
Obj.I := 0;
end;
begin
Obj.I := 0;
end Renaming9;
package Renaming9 is
pragma Elaborate_Body;
type Object is tagged null record;
type Pointer is access all Object'Class;
type Derived is new Object with record
I : Integer;
end record;
Ptr : Pointer := new Derived;
Obj : Derived renames Derived (Ptr.all);
end Renaming9;
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