+2015-11-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Use case #1
+ for the renaming of an address.
+
2015-11-18 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (fold_constant_decl_in_expr) <ARRAY_REF>: If
function call is a constant object. Therefore, it can be the
inner object of a constant renaming and the renaming must be
fully instantiated, i.e. it cannot be a reference to (part of)
- an existing object. And treat null expressions, constructors
- and literals the same way. */
+ an existing object. And treat other rvalues (addresses, null
+ expressions, constructors and literals) the same way. */
tree inner = gnu_expr;
while (handled_component_p (inner) || CONVERT_EXPR_P (inner))
inner = TREE_OPERAND (inner, 0);
inner = TREE_OPERAND (inner, 1);
if ((TREE_CODE (inner) == CALL_EXPR
&& !call_is_atomic_load (inner))
+ || TREE_CODE (inner) == ADDR_EXPR
|| TREE_CODE (inner) == NULL_EXPR
|| TREE_CODE (inner) == CONSTRUCTOR
|| CONSTANT_CLASS_P (inner))
+2015-11-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/renaming7.adb: New test.
+ * gnat.dg/renaming7_pkg.ads: New helper.
+
2015-11-18 Ajit Agarwal <ajitkum@xilinx.com>
PR tree-optimization/68402
--- /dev/null
+-- { dg-do compile }
+-- { dg-options "-O" }
+
+with Renaming7_Pkg; use Renaming7_Pkg;
+with System;
+
+procedure Renaming7 is
+ C : constant System.Address := A'Address;
+ D : System.Address renames C;
+begin
+ null;
+end;