ada-tree.h (DECL_RETURN_VALUE_P): New macro.
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 29 Feb 2016 09:02:46 +0000 (09:02 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 29 Feb 2016 09:02:46 +0000 (09:02 +0000)
commit93e708f9c3dba10010b56e897fbb89f93d10a21b
tree393bcdf9df2f8ceab15cb45aae341cbc2d86146c
parent6512bc931455f0437a0a8eab44232b4483ba16fb
ada-tree.h (DECL_RETURN_VALUE_P): New macro.

* gcc-interface/ada-tree.h (DECL_RETURN_VALUE_P): New macro.
* gcc-interface/gigi.h (gigi): Remove useless attribute.
(gnat_gimplify_expr): Likewise.
(gnat_to_gnu_external): Declare.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Constant>: Factor out
code dealing with the expression of external constants into...
Invoke gnat_to_gnu_external instead.
<E_Variable>: Invoke gnat_to_gnu_external to translate renamed objects
when not for a definition.  Deal with COMPOUND_EXPR and variables with
DECL_RETURN_VALUE_P set for renamings and with the case of a dangling
'reference to a function call in a renaming.  Remove obsolete test and
adjust associated comment.
* gcc-interface/trans.c (Call_to_gnu): Set DECL_RETURN_VALUE_P on the
temporaries created to hold the return value, if any.
(gnat_to_gnu_external): ...this.  New function.
* gcc-interface/utils.c (create_var_decl): Detect a constant created
to hold 'reference to function call.
* gcc-interface/utils2.c (build_unary_op) <ADDR_EXPR>: Add folding
for COMPOUND_EXPR in the DECL_RETURN_VALUE_P case.

From-SVN: r233804
14 files changed:
gcc/ada/ChangeLog
gcc/ada/gcc-interface/ada-tree.h
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/gigi.h
gcc/ada/gcc-interface/trans.c
gcc/ada/gcc-interface/utils.c
gcc/ada/gcc-interface/utils2.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/renaming8.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/renaming8_pkg1.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/renaming8_pkg2.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/renaming8_pkg2.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/renaming8_pkg3.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/renaming8_pkg3.ads [new file with mode: 0644]