From 9e851845f6bcd7c13f3d42c13cd2f1c0e87f68cc Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 28 Nov 2017 09:43:32 +0100 Subject: tree.def (SWITCH_EXPR): Change from 3 operand to 2 operand tree. * tree.def (SWITCH_EXPR): Change from 3 operand to 2 operand tree. Adjust comment. * tree.h (SWITCH_LABELS): Remove. * gimplify.c (gimplify_switch_expr): Don't test SWITCH_LABELS, assert SWITCH_BODY is non-NULL. * tree-pretty-print.c (dump_generic_node): Remove SWITCH_LABELS handling. * tree.c (block_may_fallthru): Always return true; for SWITCH_EXPR. c/ * c-typeck.c (c_start_case): Build SWITCH_EXPR using build2 instead of build3. cp/ * cp-gimplify.c (genericize_switch_stmt): Build SWITCH_EXPR using build2_loc instead of build3_loc. ada/ * gcc-interface/trans.c (Case_Statement_to_gnu): Build SWITCH_EXPR using build2 instead of build3. jit/ * jit-playback.c (add_switch): Build SWITCH_EXPR using build2 instead of build3. Formatting fixes. Adjust funciton comment. fortran/ * trans-decl.c (gfc_trans_entry_master_switch): Build SWITCH_EXPR using fold_build2_loc instead of fold_build3_loc. * trans-io.c (io_result): Likewise. * trans-stmt.c (gfc_trans_integer_select, gfc_trans_character_select): Likewise. go/ * go-gcc.cc (Gcc_backend::switch_statement): Build SWITCH_EXPR using build2_loc instead of build3_loc. brig/ * brigfrontend/brig-branch-inst-handler.cc (brig_branch_inst_handler::operator): Build SWITCH_EXPR using build2 instead of build3. From-SVN: r255192 --- gcc/c/ChangeLog | 5 +++++ gcc/c/c-typeck.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 087a1e7..cb1cd30 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2017-11-28 Jakub Jelinek + + * c-typeck.c (c_start_case): Build SWITCH_EXPR using build2 instead + of build3. + 2017-11-14 Boris Kolpackov * Make-lang.in (c.install-plugin): Install backend import library. diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 7f85c6b..a4d3d39 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -10330,7 +10330,7 @@ c_start_case (location_t switch_loc, /* Add this new SWITCH_EXPR to the stack. */ cs = XNEW (struct c_switch); - cs->switch_expr = build3 (SWITCH_EXPR, orig_type, exp, NULL_TREE, NULL_TREE); + cs->switch_expr = build2 (SWITCH_EXPR, orig_type, exp, NULL_TREE); SET_EXPR_LOCATION (cs->switch_expr, switch_loc); cs->orig_type = orig_type; cs->cases = splay_tree_new (case_compare, NULL, NULL); -- cgit v1.1