diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2019-11-25 10:48:55 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2019-11-25 10:48:55 +0000 |
commit | d587d1e4aa6a33372f64b0f3983ef66afa3d1897 (patch) | |
tree | 5be921b4dc8697403ff531e31f135ddf88ee3922 /gcc/ada/gcc-interface/trans.c | |
parent | 32bef8ff8090a0d108fa14fc4088e55e57a5e6d5 (diff) | |
download | gcc-d587d1e4aa6a33372f64b0f3983ef66afa3d1897.zip gcc-d587d1e4aa6a33372f64b0f3983ef66afa3d1897.tar.gz gcc-d587d1e4aa6a33372f64b0f3983ef66afa3d1897.tar.bz2 |
re PR ada/92362 (double elaboration of expression in Address aspect)
PR ada/92362
* gcc-interface/trans.c (gnat_to_gnu) <N_Attribute_Definition_Clause>:
Use a temporary instead of clobbering the result with a freeze node.
From-SVN: r278675
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 61e05d5..3d6f381 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -8421,7 +8421,7 @@ gnat_to_gnu (Node_Id gnat_node) gnat_temp = Entity (Name (gnat_node)); if (Freeze_Node (gnat_temp)) { - tree gnu_address = gnat_to_gnu (Expression (gnat_node)); + tree gnu_address = gnat_to_gnu (Expression (gnat_node)), gnu_temp; /* Get the value to use as the address and save it as the equivalent for the object; when it is frozen, gnat_to_gnu_entity will do the @@ -8431,7 +8431,7 @@ gnat_to_gnu (Node_Id gnat_node) of the object is limited and it is initialized with the result of a function call. */ if (Is_Subprogram (gnat_temp)) - gnu_result = gnu_address; + gnu_temp = gnu_address; else { tree gnu_type = gnat_to_gnu_type (Etype (gnat_temp)); @@ -8440,11 +8440,11 @@ gnat_to_gnu (Node_Id gnat_node) gnu_type = build_reference_type_for_mode (gnu_type, ptr_mode, true); gnu_address = convert (gnu_type, gnu_address); - gnu_result + gnu_temp = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_address); } - save_gnu_tree (gnat_temp, gnu_result, true); + save_gnu_tree (gnat_temp, gnu_temp, true); } break; |