Commit 22d12fc2 by Eric Botcazou Committed by Eric Botcazou

trans.c (lvalue_required_p): New case.

	* gcc-interface/trans.c (lvalue_required_p) <N_Unchecked_Conversion>:
	New case.

From-SVN: r153948
parent 4b7dd692
2009-11-05 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (lvalue_required_p) <N_Unchecked_Conversion>:
New case.
2009-10-30 Eric Botcazou <ebotcazou@adacore.com> 2009-10-30 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.c (MAX_FIXED_MODE_SIZE): Delete. * gcc-interface/utils.c (MAX_FIXED_MODE_SIZE): Delete.
......
...@@ -657,17 +657,16 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, ...@@ -657,17 +657,16 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
error_gnat_node = Empty; error_gnat_node = Empty;
} }
/* Return a positive value if an lvalue is required for GNAT_NODE. /* Return a positive value if an lvalue is required for GNAT_NODE. GNU_TYPE
GNU_TYPE is the type that will be used for GNAT_NODE in the is the type that will be used for GNAT_NODE in the translated GNU tree.
translated GNU tree. CONSTANT indicates whether the underlying CONSTANT indicates whether the underlying object represented by GNAT_NODE
object represented by GNAT_NODE is constant in the Ada sense, is constant in the Ada sense, ALIASED whether it is aliased (but the latter
ALIASED whether it is aliased (but the latter doesn't affect doesn't affect the outcome if CONSTANT is not true).
the outcome if CONSTANT is not true).
The function climbs up the GNAT tree starting from the node and returns 1
The function climbs up the GNAT tree starting from the node and upon encountering a node that effectively requires an lvalue downstream.
returns 1 upon encountering a node that effectively requires an It returns int instead of bool to facilitate usage in non-purely binary
lvalue downstream. It returns int instead of bool to facilitate logic contexts. */
usage in non purely binary logic contexts. */
static int static int
lvalue_required_p (Node_Id gnat_node, tree gnu_type, bool constant, lvalue_required_p (Node_Id gnat_node, tree gnu_type, bool constant,
...@@ -754,6 +753,13 @@ lvalue_required_p (Node_Id gnat_node, tree gnu_type, bool constant, ...@@ -754,6 +753,13 @@ lvalue_required_p (Node_Id gnat_node, tree gnu_type, bool constant,
|| (Is_Composite_Type (Underlying_Type (Etype (gnat_node))) || (Is_Composite_Type (Underlying_Type (Etype (gnat_node)))
&& Is_Atomic (Entity (Name (gnat_parent))))); && Is_Atomic (Entity (Name (gnat_parent)))));
case N_Unchecked_Type_Conversion:
/* Returning 0 is very likely correct but we get better code if we
go through the conversion. */
return lvalue_required_p (gnat_parent,
get_unpadded_type (Etype (gnat_parent)),
constant, aliased);
default: default:
return 0; return 0;
} }
......
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