Commit 36716ee7 authored by ebotcazou's avatar ebotcazou

* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with

	more rvalues in the expression of a renaming.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-8-branch@262808 138bc75d-0d04-0410-961f-82ee72b054a4
parent b50d76fe
2018-07-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
2018-07-17 Eric Botcazou <ebotcazou@adacore.com>
Backport from mainline
2018-07-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Deal with
more rvalues in the expression of a renaming.
2018-07-06 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libgnat/system-rtems.ads (Frontend_Exceptions): Set to False.
(ZCX_By_Default): Set to True.
......
......@@ -950,8 +950,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
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 other rvalues (addresses, null
expressions, constructors and literals) the same way. */
an existing object. And treat other rvalues the same way. */
tree inner = gnu_expr;
while (handled_component_p (inner) || CONVERT_EXPR_P (inner))
inner = TREE_OPERAND (inner, 0);
......@@ -962,11 +961,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
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) == PLUS_EXPR
|| TREE_CODE (inner) == CONSTRUCTOR
|| CONSTANT_CLASS_P (inner)
|| COMPARISON_CLASS_P (inner)
|| BINARY_CLASS_P (inner)
|| EXPRESSION_CLASS_P (inner)
/* We need to detect the case where a temporary is created to
hold the return value, since we cannot safely rename it at
top level as it lives only in the elaboration routine. */
......@@ -988,7 +987,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
underlying object lives only in the elaboration routine. */
|| (TREE_CODE (inner) == INDIRECT_REF
&& (inner
= remove_conversions (TREE_OPERAND (inner, 0), true))
= remove_conversions (TREE_OPERAND (inner, 0), true))
&& TREE_CODE (inner) == VAR_DECL
&& DECL_RETURN_VALUE_P (inner)))
;
......
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