From: ebotcazou Date: Thu, 5 Nov 2009 18:25:10 +0000 (+0000) Subject: * gcc-interface/trans.c (lvalue_required_p) : X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b9124b1649cb2e38db9193058cf190f382a08b8;p=thirdparty%2Fgcc.git * gcc-interface/trans.c (lvalue_required_p) : New case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153948 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 4dc41876af48..42ad20e15fde 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2009-11-05 Eric Botcazou + + * gcc-interface/trans.c (lvalue_required_p) : + New case. + 2009-10-30 Eric Botcazou * gcc-interface/utils.c (MAX_FIXED_MODE_SIZE): Delete. diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 58afbfddac68..41be8bb77af4 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -657,17 +657,16 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name, error_gnat_node = Empty; } -/* Return a positive value if an lvalue is required for GNAT_NODE. - GNU_TYPE is the type that will be used for GNAT_NODE in the - translated GNU tree. CONSTANT indicates whether the underlying - object represented by GNAT_NODE is constant in the Ada sense, - ALIASED whether it is aliased (but the latter doesn't affect - the outcome if CONSTANT is not true). - - The function climbs up the GNAT tree starting from the node and - returns 1 upon encountering a node that effectively requires an - lvalue downstream. It returns int instead of bool to facilitate - usage in non purely binary logic contexts. */ +/* Return a positive value if an lvalue is required for GNAT_NODE. GNU_TYPE + is the type that will be used for GNAT_NODE in the translated GNU tree. + CONSTANT indicates whether the underlying object represented by GNAT_NODE + is constant in the Ada sense, ALIASED whether it is aliased (but the latter + doesn't affect the outcome if CONSTANT is not true). + + The function climbs up the GNAT tree starting from the node and returns 1 + upon encountering a node that effectively requires an lvalue downstream. + It returns int instead of bool to facilitate usage in non-purely binary + logic contexts. */ static int 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_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: return 0; }