diff options
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 5a93447..a2f9623 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -104,38 +104,38 @@ tree gimple_assign_rhs_to_tree (gimple *stmt) { tree t; - enum gimple_rhs_class grhs_class; - - grhs_class = get_gimple_rhs_class (gimple_expr_code (stmt)); - - if (grhs_class == GIMPLE_TERNARY_RHS) - t = build3 (gimple_assign_rhs_code (stmt), - TREE_TYPE (gimple_assign_lhs (stmt)), - gimple_assign_rhs1 (stmt), - gimple_assign_rhs2 (stmt), - gimple_assign_rhs3 (stmt)); - else if (grhs_class == GIMPLE_BINARY_RHS) - t = build2 (gimple_assign_rhs_code (stmt), - TREE_TYPE (gimple_assign_lhs (stmt)), - gimple_assign_rhs1 (stmt), - gimple_assign_rhs2 (stmt)); - else if (grhs_class == GIMPLE_UNARY_RHS) - t = build1 (gimple_assign_rhs_code (stmt), - TREE_TYPE (gimple_assign_lhs (stmt)), - gimple_assign_rhs1 (stmt)); - else if (grhs_class == GIMPLE_SINGLE_RHS) - { - t = gimple_assign_rhs1 (stmt); - /* Avoid modifying this tree in place below. */ - if ((gimple_has_location (stmt) && CAN_HAVE_LOCATION_P (t) - && gimple_location (stmt) != EXPR_LOCATION (t)) - || (gimple_block (stmt) - && currently_expanding_to_rtl - && EXPR_P (t))) - t = copy_node (t); + switch (get_gimple_rhs_class (gimple_expr_code (stmt))) + { + case GIMPLE_TERNARY_RHS: + t = build3 (gimple_assign_rhs_code (stmt), + TREE_TYPE (gimple_assign_lhs (stmt)), + gimple_assign_rhs1 (stmt), gimple_assign_rhs2 (stmt), + gimple_assign_rhs3 (stmt)); + break; + case GIMPLE_BINARY_RHS: + t = build2 (gimple_assign_rhs_code (stmt), + TREE_TYPE (gimple_assign_lhs (stmt)), + gimple_assign_rhs1 (stmt), gimple_assign_rhs2 (stmt)); + break; + case GIMPLE_UNARY_RHS: + t = build1 (gimple_assign_rhs_code (stmt), + TREE_TYPE (gimple_assign_lhs (stmt)), + gimple_assign_rhs1 (stmt)); + break; + case GIMPLE_SINGLE_RHS: + { + t = gimple_assign_rhs1 (stmt); + /* Avoid modifying this tree in place below. */ + if ((gimple_has_location (stmt) && CAN_HAVE_LOCATION_P (t) + && gimple_location (stmt) != EXPR_LOCATION (t)) + || (gimple_block (stmt) && currently_expanding_to_rtl + && EXPR_P (t))) + t = copy_node (t); + break; + } + default: + gcc_unreachable (); } - else - gcc_unreachable (); if (gimple_has_location (stmt) && CAN_HAVE_LOCATION_P (t)) SET_EXPR_LOCATION (t, gimple_location (stmt)); |