aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils2.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-09-11 19:14:51 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-09-11 19:14:51 +0000
commit7e169899559dd04cbde3bf6e0599720e6918a461 (patch)
treef19f0298aa8dad59a5d734a4bb0796ab0a2169e7 /gcc/ada/gcc-interface/utils2.c
parent819a653eee396dc4db95ddc3c87805acab08c2de (diff)
downloadgcc-7e169899559dd04cbde3bf6e0599720e6918a461.zip
gcc-7e169899559dd04cbde3bf6e0599720e6918a461.tar.gz
gcc-7e169899559dd04cbde3bf6e0599720e6918a461.tar.bz2
utils.c (maybe_unconstrained_array): In the reference to unconstrained array case, deal with each branch of a COND_EXPR.
* gcc-interface/utils.c (maybe_unconstrained_array): In the reference to unconstrained array case, deal with each branch of a COND_EXPR. * gcc-interface/utils2.c (build_allocator): Deal with each branch of a COND_EXPR in the initializer, if present. From-SVN: r178766
Diffstat (limited to 'gcc/ada/gcc-interface/utils2.c')
-rw-r--r--gcc/ada/gcc-interface/utils2.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index 424a0c0..87cb269 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -2046,6 +2046,16 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
if (init && TREE_CODE (init) == NULL_EXPR)
return build1 (NULL_EXPR, result_type, TREE_OPERAND (init, 0));
+ /* If the initializer, if present, is a COND_EXPR, deal with each branch. */
+ else if (init && TREE_CODE (init) == COND_EXPR)
+ return build3 (COND_EXPR, result_type, TREE_OPERAND (init, 0),
+ build_allocator (type, TREE_OPERAND (init, 1), result_type,
+ gnat_proc, gnat_pool, gnat_node,
+ ignore_init_type),
+ build_allocator (type, TREE_OPERAND (init, 2), result_type,
+ gnat_proc, gnat_pool, gnat_node,
+ ignore_init_type));
+
/* If RESULT_TYPE is a fat or thin pointer, set SIZE to be the sum of the
sizes of the object and its template. Allocate the whole thing and
fill in the parts that are known. */