diff options
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r-- | gcc/ada/utils.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index edd1706..baec9ff 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -2703,9 +2703,10 @@ convert (tree type, tree expr) /* If we have just converted to this padded type, just get the inner expression. */ if (TREE_CODE (expr) == CONSTRUCTOR - && CONSTRUCTOR_ELTS (expr) - && TREE_PURPOSE (CONSTRUCTOR_ELTS (expr)) == TYPE_FIELDS (etype)) - return TREE_VALUE (CONSTRUCTOR_ELTS (expr)); + && !VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (expr)) + && VEC_index (constructor_elt, CONSTRUCTOR_ELTS (expr), 0)->index + == TYPE_FIELDS (etype)) + return VEC_index (constructor_elt, CONSTRUCTOR_ELTS (expr), 0)->value; else return convert (type, build_component_ref (expr, NULL_TREE, @@ -3025,7 +3026,9 @@ remove_conversions (tree exp, bool true_address) if (true_address && TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE && TYPE_JUSTIFIED_MODULAR_P (TREE_TYPE (exp))) - return remove_conversions (TREE_VALUE (CONSTRUCTOR_ELTS (exp)), true); + return remove_conversions (VEC_index (constructor_elt, + CONSTRUCTOR_ELTS (exp), 0)->value, + true); break; case COMPONENT_REF: |