aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-09-12 12:47:39 +0200
committerEric Botcazou <ebotcazou@adacore.com>2020-09-12 12:47:39 +0200
commitfe47e8163928d2cc42ad84634cfd147f948aad4a (patch)
treec88158b031825e42dd913860df20550440e007d2 /gcc/ada/gcc-interface
parentb440715089382938b9729d20f5dcaf646e6372fd (diff)
downloadgcc-fe47e8163928d2cc42ad84634cfd147f948aad4a.zip
gcc-fe47e8163928d2cc42ad84634cfd147f948aad4a.tar.gz
gcc-fe47e8163928d2cc42ad84634cfd147f948aad4a.tar.bz2
Fix small inconsistency in new predicate
This can result on the mainline in a segfault when an object declared at library level is used in the declaration of another, local object. gcc/ada/ChangeLog: * gcc-interface/trans.c (lvalue_for_aggr_p) <N_Object_Declaration>: Return false unconditionally.
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r--gcc/ada/gcc-interface/trans.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index aa4393c..39d4d28 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -968,12 +968,8 @@ lvalue_for_aggregate_p (Node_Id gnat_node, tree gnu_type)
get_unpadded_type (Etype (gnat_parent)));
case N_Object_Declaration:
- /* For an aggregate object declaration, return the constant at top level
- in order to avoid generating elaboration code. */
- if (global_bindings_p ())
- return false;
-
- /* ... fall through ... */
+ /* For an aggregate object declaration, return false consistently. */
+ return false;
case N_Assignment_Statement:
/* For an aggregate assignment, decide based on the size. */