decl.c (gnat_to_gnu_entity): Deal with PLUS_EXPR in the expression of a renaming.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with PLUS_EXPR in the expression of a renaming. From-SVN: r237360
This commit is contained in:
parent
7474dcc1fe
commit
42e77cbc7d
|
@ -1,3 +1,8 @@
|
|||
2016-06-13 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with
|
||||
PLUS_EXPR in the expression of a renaming.
|
||||
|
||||
2016-06-13 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gcc-interface/utils2.c (known_alignment) <CALL_EXPR>: Deal specially
|
||||
|
|
|
@ -1003,6 +1003,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
|
|||
&& !call_is_atomic_load (inner))
|
||||
|| TREE_CODE (inner) == ADDR_EXPR
|
||||
|| TREE_CODE (inner) == NULL_EXPR
|
||||
|| TREE_CODE (inner) == PLUS_EXPR
|
||||
|| TREE_CODE (inner) == CONSTRUCTOR
|
||||
|| CONSTANT_CLASS_P (inner)
|
||||
/* We need to detect the case where a temporary is created to
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2016-06-13 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gnat.dg/renaming10.ad[sb]: New test.
|
||||
|
||||
2016-06-13 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
PR fortran/70673
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
-- { dg-do compile }
|
||||
|
||||
package body Renaming10 is
|
||||
|
||||
function F (Input : Rec) return Natural is
|
||||
Position : Natural renames Input.Position;
|
||||
Index : Natural renames Natural'Succ(Position);
|
||||
begin
|
||||
return Index;
|
||||
end;
|
||||
|
||||
end Renaming10;
|
|
@ -0,0 +1,9 @@
|
|||
package Renaming10 is
|
||||
|
||||
type Rec is record
|
||||
Position : Natural;
|
||||
end record;
|
||||
|
||||
function F (Input : Rec) return Natural;
|
||||
|
||||
end Renaming10;
|
Loading…
Reference in New Issue