From: Jason Merrill Date: Mon, 4 Oct 1999 08:30:28 +0000 (+0000) Subject: * init.c (build_vec_delete_1): Fold COND_EXPRs. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37f88e3ea0d4548ac3f8c06a24b0d7e257385ae4;p=platform%2Fupstream%2Fgcc.git * init.c (build_vec_delete_1): Fold COND_EXPRs. From-SVN: r29796 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 982c00d..21ea589 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +1999-10-04 Jason Merrill + + * init.c (build_vec_delete_1): Fold COND_EXPRs. + 1999-10-03 Mark Mitchell * cp-tree.def (VEC_INIT_EXPR): Remove. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 40fd8c9..e6a1c5f 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -2526,10 +2526,10 @@ build_vec_delete_1 (base, maxindex, type, auto_delete_vec, auto_delete, build_x_delete (base_tbd, 2 | use_global_delete, virtual_size)); - body = build (COND_EXPR, void_type_node, - build (BIT_AND_EXPR, integer_type_node, - auto_delete, integer_one_node), - body, integer_zero_node); + body = fold (build (COND_EXPR, void_type_node, + fold (build (BIT_AND_EXPR, integer_type_node, + auto_delete, integer_one_node)), + body, integer_zero_node)); } else body = NULL_TREE; @@ -2581,11 +2581,12 @@ build_vec_delete_1 (base, maxindex, type, auto_delete_vec, auto_delete, deallocate_expr = build_x_delete (base_tbd, 2 | use_global_delete, virtual_size); - if (auto_delete_vec != integer_one_node) - deallocate_expr = build (COND_EXPR, void_type_node, - build (BIT_AND_EXPR, integer_type_node, - auto_delete_vec, integer_one_node), - deallocate_expr, integer_zero_node); + deallocate_expr = fold (build (COND_EXPR, void_type_node, + fold (build (BIT_AND_EXPR, + integer_type_node, + auto_delete_vec, + integer_one_node)), + deallocate_expr, integer_zero_node)); } if (loop && deallocate_expr != integer_zero_node) @@ -2598,9 +2599,10 @@ build_vec_delete_1 (base, maxindex, type, auto_delete_vec, auto_delete, body = loop; /* Outermost wrapper: If pointer is null, punt. */ - body = build (COND_EXPR, void_type_node, - build (NE_EXPR, boolean_type_node, base, integer_zero_node), - body, integer_zero_node); + body = fold (build (COND_EXPR, void_type_node, + fold (build (NE_EXPR, boolean_type_node, base, + integer_zero_node)), + body, integer_zero_node)); body = build1 (NOP_EXPR, void_type_node, body); if (controller)