On 11/27/2017 03:41 PM, Jakub Jelinek wrote:
> Hi!
> 
> Before tuples SWITCH_LABELS used to hold the vectors of case labels
> during optimization, then it was used during expansion - GIMPLE_SWITCH
> has been converted back to SWITCH_EXPR and SWITCH_LABELS used to hold
> the vector.  Later on we've switched to expand_case right from
> GIMPLE_SWITCH, and since then SWITCH_LABELS is always NULL_TREE,
> no FEs ever set it to anything different, and aside from block_may_fallthru
> and dump_generic_node and a left-over assert in the gimplifier nothing
> really uses it.  The gimplifier will not really work if some FE would
> decide to fill it in though, see David's comment in the jit FE about his
> attempts.
> 
> So, this patch just removes that, turns SWITCH_EXPR into a 2 operand only
> tree.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> 2017-11-27  Jakub Jelinek  <ja...@redhat.com>
> 
>       * 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.
OK.
jeff

Reply via email to