Mercurial > hg > CbC > CbC_gcc
diff gcc/gimple.c @ 70:b81903832de2
merge c-decl.c
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 21 Aug 2011 09:24:16 +0900 |
parents | 1b10fe6932e1 |
children | ce75bd9117e4 |
line wrap: on
line diff
--- a/gcc/gimple.c Sun Aug 21 07:53:12 2011 +0900 +++ b/gcc/gimple.c Sun Aug 21 09:24:16 2011 +0900 @@ -33,9 +33,6 @@ #include "tree-flow.h" #include "value-prof.h" #include "flags.h" -#ifndef noCbC -#include "cbc-tree.h" -#endif #include "alias.h" #include "demangle.h" #include "langhooks.h" @@ -63,7 +60,7 @@ operands vector the size of the structure minus the size of the 1 element tree array at the end (see gimple_ops). */ #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) \ - (HAS_TREE_OP ? sizeof (struct STRUCT) - sizeof (tree) : 0), + (HAS_TREE_OP ? sizeof (struct STRUCT) - sizeof (tree) : 0), EXPORTED_CONST size_t gimple_ops_offset_[] = { #include "gsstruct.def" }; @@ -75,13 +72,13 @@ }; #undef DEFGSSTRUCT -#define DEFGSCODE(SYM, NAME, GSSCODE) NAME, +#define DEFGSCODE(SYM, NAME, GSSCODE) NAME, const char *const gimple_code_name[] = { #include "gimple.def" }; #undef DEFGSCODE -#define DEFGSCODE(SYM, NAME, GSSCODE) GSSCODE, +#define DEFGSCODE(SYM, NAME, GSSCODE) GSSCODE, EXPORTED_CONST enum gimple_statement_structure_enum gss_for_code_[] = { #include "gimple.def" }; @@ -188,7 +185,7 @@ static gimple gimple_build_with_ops_stat (enum gimple_code code, unsigned subcode, - unsigned num_ops MEM_STAT_DECL) + unsigned num_ops MEM_STAT_DECL) { gimple s = gimple_alloc_stat (code, num_ops PASS_MEM_STAT); gimple_set_subcode (s, subcode); @@ -307,9 +304,6 @@ gimple_call_set_return_slot_opt (call, CALL_EXPR_RETURN_SLOT_OPT (t)); gimple_call_set_from_thunk (call, CALL_FROM_THUNK_P (t)); gimple_call_set_va_arg_pack (call, CALL_EXPR_VA_ARG_PACK (t)); -#ifndef noCbC - gimple_call_set_cbc_goto (call, CALL_EXPR_CbC_GOTO (t)); -#endif gimple_call_set_nothrow (call, TREE_NOTHROW (t)); gimple_set_no_warning (call, TREE_NO_WARNING (t)); @@ -391,7 +385,7 @@ num_ops = get_gimple_rhs_num_ops (subcode) + 1; p = gimple_build_with_ops_stat (GIMPLE_ASSIGN, (unsigned)subcode, num_ops - PASS_MEM_STAT); + PASS_MEM_STAT); gimple_assign_set_lhs (p, lhs); gimple_assign_set_rhs1 (p, op1); if (op2) @@ -436,7 +430,7 @@ gimple gimple_build_cond (enum tree_code pred_code, tree lhs, tree rhs, - tree t_label, tree f_label) + tree t_label, tree f_label) { gimple p; @@ -457,9 +451,9 @@ tree *lhs_p, tree *rhs_p) { gcc_assert (TREE_CODE_CLASS (TREE_CODE (cond)) == tcc_comparison - || TREE_CODE (cond) == TRUTH_NOT_EXPR - || is_gimple_min_invariant (cond) - || SSA_VAR_P (cond)); + || TREE_CODE (cond) == TRUTH_NOT_EXPR + || is_gimple_min_invariant (cond) + || SSA_VAR_P (cond)); extract_ops_from_tree (cond, code_p, lhs_p, rhs_p); @@ -572,7 +566,7 @@ gcc_assert (nlabels == 0 || noutputs == 0); p = gimple_build_with_ops (GIMPLE_ASM, ERROR_MARK, - ninputs + noutputs + nclobbers + nlabels); + ninputs + noutputs + nclobbers + nlabels); p->gimple_asm.ni = ninputs; p->gimple_asm.no = noutputs; @@ -601,7 +595,7 @@ gimple gimple_build_asm_vec (const char *string, VEC(tree,gc)* inputs, VEC(tree,gc)* outputs, VEC(tree,gc)* clobbers, - VEC(tree,gc)* labels) + VEC(tree,gc)* labels) { gimple p; unsigned i; @@ -610,7 +604,7 @@ VEC_length (tree, inputs), VEC_length (tree, outputs), VEC_length (tree, clobbers), - VEC_length (tree, labels)); + VEC_length (tree, labels)); for (i = 0; i < VEC_length (tree, inputs); i++) gimple_asm_set_input_op (p, i, VEC_index (tree, inputs, i)); @@ -682,7 +676,7 @@ gimple gimple_build_try (gimple_seq eval, gimple_seq cleanup, - enum gimple_try_flags kind) + enum gimple_try_flags kind) { gimple p; @@ -733,7 +727,7 @@ { /* nlabels + 1 default label + 1 index. */ gimple p = gimple_build_with_ops (GIMPLE_SWITCH, ERROR_MARK, - 1 + (default_label != NULL) + nlabels); + 1 + (default_label != NULL) + nlabels); gimple_switch_set_index (p, index); if (default_label) gimple_switch_set_default_label (p, default_label); @@ -803,8 +797,8 @@ gimple_build_debug_bind_stat (tree var, tree value, gimple stmt MEM_STAT_DECL) { gimple p = gimple_build_with_ops_stat (GIMPLE_DEBUG, - (unsigned)GIMPLE_DEBUG_BIND, 2 - PASS_MEM_STAT); + (unsigned)GIMPLE_DEBUG_BIND, 2 + PASS_MEM_STAT); gimple_debug_bind_set_var (p, var); gimple_debug_bind_set_value (p, value); @@ -844,7 +838,7 @@ gimple gimple_build_omp_for (gimple_seq body, tree clauses, size_t collapse, - gimple_seq pre_body) + gimple_seq pre_body) { gimple p = gimple_alloc (GIMPLE_OMP_FOR, 0); if (body) @@ -869,7 +863,7 @@ gimple gimple_build_omp_parallel (gimple_seq body, tree clauses, tree child_fn, - tree data_arg) + tree data_arg) { gimple p = gimple_alloc (GIMPLE_OMP_PARALLEL, 0); if (body) @@ -893,8 +887,8 @@ gimple gimple_build_omp_task (gimple_seq body, tree clauses, tree child_fn, - tree data_arg, tree copy_fn, tree arg_size, - tree arg_align) + tree data_arg, tree copy_fn, tree arg_size, + tree arg_align) { gimple p = gimple_alloc (GIMPLE_OMP_TASK, 0); if (body) @@ -1071,17 +1065,17 @@ void gimple_check_failed (const_gimple gs, const char *file, int line, - const char *function, enum gimple_code code, - enum tree_code subcode) + const char *function, enum gimple_code code, + enum tree_code subcode) { internal_error ("gimple check: expected %s(%s), have %s(%s) in %s, at %s:%d", - gimple_code_name[code], - tree_code_name[subcode], - gimple_code_name[gimple_code (gs)], - gs->gsbase.subcode > 0 - ? tree_code_name[gs->gsbase.subcode] - : "", - function, trim_filename (file), line); + gimple_code_name[code], + tree_code_name[subcode], + gimple_code_name[gimple_code (gs)], + gs->gsbase.subcode > 0 + ? tree_code_name[gs->gsbase.subcode] + : "", + function, trim_filename (file), line); } #endif /* ENABLE_GIMPLE_CHECKING */ @@ -1196,7 +1190,7 @@ return true; for (i = gsi_start (body); !gsi_end_p (i); gsi_next (&i)) if (!empty_stmt_p (gsi_stmt (i)) - && !is_gimple_debug (gsi_stmt (i))) + && !is_gimple_debug (gsi_stmt (i))) return false; return true; @@ -1233,7 +1227,7 @@ gimple walk_gimple_seq (gimple_seq seq, walk_stmt_fn callback_stmt, - walk_tree_fn callback_op, struct walk_stmt_info *wi) + walk_tree_fn callback_op, struct walk_stmt_info *wi) { gimple_stmt_iterator gsi; @@ -1241,13 +1235,13 @@ { tree ret = walk_gimple_stmt (&gsi, callback_stmt, callback_op, wi); if (ret) - { - /* If CALLBACK_STMT or CALLBACK_OP return a value, WI must exist - to hold it. */ - gcc_assert (wi); - wi->callback_result = ret; - return gsi_stmt (gsi); - } + { + /* If CALLBACK_STMT or CALLBACK_OP return a value, WI must exist + to hold it. */ + gcc_assert (wi); + wi->callback_result = ret; + return gsi_stmt (gsi); + } } if (wi) @@ -1261,7 +1255,7 @@ static tree walk_gimple_asm (gimple stmt, walk_tree_fn callback_op, - struct walk_stmt_info *wi) + struct walk_stmt_info *wi) { tree ret, op; unsigned noutputs; @@ -1282,12 +1276,12 @@ constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op))); oconstraints[i] = constraint; parse_output_constraint (&constraint, i, 0, 0, &allows_mem, &allows_reg, - &is_inout); + &is_inout); if (wi) - wi->val_only = (allows_reg || !allows_mem); + wi->val_only = (allows_reg || !allows_mem); ret = walk_tree (&TREE_VALUE (op), callback_op, wi, NULL); if (ret) - return ret; + return ret; } n = gimple_asm_ninputs (stmt); @@ -1296,16 +1290,16 @@ op = gimple_asm_input_op (stmt, i); constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op))); parse_input_constraint (&constraint, 0, 0, noutputs, 0, - oconstraints, &allows_mem, &allows_reg); + oconstraints, &allows_mem, &allows_reg); if (wi) - { - wi->val_only = (allows_reg || !allows_mem); + { + wi->val_only = (allows_reg || !allows_mem); /* Although input "m" is not really a LHS, we need a lvalue. */ - wi->is_lhs = !wi->val_only; - } + wi->is_lhs = !wi->val_only; + } ret = walk_tree (&TREE_VALUE (op), callback_op, wi, NULL); if (ret) - return ret; + return ret; } if (wi) @@ -1320,7 +1314,7 @@ op = gimple_asm_label_op (stmt, i); ret = walk_tree (&TREE_VALUE (op), callback_op, wi, NULL); if (ret) - return ret; + return ret; } return NULL_TREE; @@ -1334,7 +1328,7 @@ Additional parameters to walk_tree must be stored in WI. For each operand OP, walk_tree is called as: - walk_tree (&OP, CALLBACK_OP, WI, WI->PSET) + walk_tree (&OP, CALLBACK_OP, WI, WI->PSET) If CALLBACK_OP returns non-NULL for an operand, the remaining operands are not scanned. @@ -1344,7 +1338,7 @@ tree walk_gimple_op (gimple stmt, walk_tree_fn callback_op, - struct walk_stmt_info *wi) + struct walk_stmt_info *wi) { struct pointer_set_t *pset = (wi) ? wi->pset : NULL; unsigned i; @@ -1364,33 +1358,33 @@ } for (i = 1; i < gimple_num_ops (stmt); i++) - { - ret = walk_tree (gimple_op_ptr (stmt, i), callback_op, wi, - pset); - if (ret) - return ret; - } + { + ret = walk_tree (gimple_op_ptr (stmt, i), callback_op, wi, + pset); + if (ret) + return ret; + } /* Walk the LHS. If the RHS is appropriate for a memory, we - may use a COMPONENT_REF on the LHS. */ + may use a COMPONENT_REF on the LHS. */ if (wi) - { + { /* If the RHS has more than 1 operand, it is not appropriate for the memory. */ - wi->val_only = !is_gimple_mem_rhs (gimple_assign_rhs1 (stmt)) + wi->val_only = !is_gimple_mem_rhs (gimple_assign_rhs1 (stmt)) || !gimple_assign_single_p (stmt); - wi->is_lhs = true; - } + wi->is_lhs = true; + } ret = walk_tree (gimple_op_ptr (stmt, 0), callback_op, wi, pset); if (ret) - return ret; + return ret; if (wi) - { - wi->val_only = true; - wi->is_lhs = false; - } + { + wi->val_only = true; + wi->is_lhs = false; + } break; case GIMPLE_CALL: @@ -1440,148 +1434,148 @@ case GIMPLE_CATCH: ret = walk_tree (gimple_catch_types_ptr (stmt), callback_op, wi, - pset); + pset); if (ret) - return ret; + return ret; break; case GIMPLE_EH_FILTER: ret = walk_tree (gimple_eh_filter_types_ptr (stmt), callback_op, wi, - pset); + pset); if (ret) - return ret; + return ret; break; case GIMPLE_ASM: ret = walk_gimple_asm (stmt, callback_op, wi); if (ret) - return ret; + return ret; break; case GIMPLE_OMP_CONTINUE: ret = walk_tree (gimple_omp_continue_control_def_ptr (stmt), - callback_op, wi, pset); + callback_op, wi, pset); if (ret) - return ret; + return ret; ret = walk_tree (gimple_omp_continue_control_use_ptr (stmt), - callback_op, wi, pset); + callback_op, wi, pset); if (ret) - return ret; + return ret; break; case GIMPLE_OMP_CRITICAL: ret = walk_tree (gimple_omp_critical_name_ptr (stmt), callback_op, wi, - pset); + pset); if (ret) - return ret; + return ret; break; case GIMPLE_OMP_FOR: ret = walk_tree (gimple_omp_for_clauses_ptr (stmt), callback_op, wi, - pset); - if (ret) - return ret; - for (i = 0; i < gimple_omp_for_collapse (stmt); i++) - { - ret = walk_tree (gimple_omp_for_index_ptr (stmt, i), callback_op, - wi, pset); + pset); if (ret) - return ret; - ret = walk_tree (gimple_omp_for_initial_ptr (stmt, i), callback_op, - wi, pset); + return ret; + for (i = 0; i < gimple_omp_for_collapse (stmt); i++) + { + ret = walk_tree (gimple_omp_for_index_ptr (stmt, i), callback_op, + wi, pset); + if (ret) + return ret; + ret = walk_tree (gimple_omp_for_initial_ptr (stmt, i), callback_op, + wi, pset); + if (ret) + return ret; + ret = walk_tree (gimple_omp_for_final_ptr (stmt, i), callback_op, + wi, pset); + if (ret) + return ret; + ret = walk_tree (gimple_omp_for_incr_ptr (stmt, i), callback_op, + wi, pset); + } if (ret) - return ret; - ret = walk_tree (gimple_omp_for_final_ptr (stmt, i), callback_op, - wi, pset); - if (ret) - return ret; - ret = walk_tree (gimple_omp_for_incr_ptr (stmt, i), callback_op, - wi, pset); - } - if (ret) - return ret; + return ret; break; case GIMPLE_OMP_PARALLEL: ret = walk_tree (gimple_omp_parallel_clauses_ptr (stmt), callback_op, - wi, pset); + wi, pset); if (ret) - return ret; + return ret; ret = walk_tree (gimple_omp_parallel_child_fn_ptr (stmt), callback_op, - wi, pset); + wi, pset); if (ret) - return ret; + return ret; ret = walk_tree (gimple_omp_parallel_data_arg_ptr (stmt), callback_op, - wi, pset); + wi, pset); if (ret) - return ret; + return ret; break; case GIMPLE_OMP_TASK: ret = walk_tree (gimple_omp_task_clauses_ptr (stmt), callback_op, - wi, pset); + wi, pset); if (ret) - return ret; + return ret; ret = walk_tree (gimple_omp_task_child_fn_ptr (stmt), callback_op, - wi, pset); + wi, pset); if (ret) - return ret; + return ret; ret = walk_tree (gimple_omp_task_data_arg_ptr (stmt), callback_op, - wi, pset); + wi, pset); if (ret) - return ret; + return ret; ret = walk_tree (gimple_omp_task_copy_fn_ptr (stmt), callback_op, - wi, pset); + wi, pset); if (ret) - return ret; + return ret; ret = walk_tree (gimple_omp_task_arg_size_ptr (stmt), callback_op, - wi, pset); + wi, pset); if (ret) - return ret; + return ret; ret = walk_tree (gimple_omp_task_arg_align_ptr (stmt), callback_op, - wi, pset); + wi, pset); if (ret) - return ret; + return ret; break; case GIMPLE_OMP_SECTIONS: ret = walk_tree (gimple_omp_sections_clauses_ptr (stmt), callback_op, - wi, pset); + wi, pset); if (ret) - return ret; + return ret; ret = walk_tree (gimple_omp_sections_control_ptr (stmt), callback_op, - wi, pset); + wi, pset); if (ret) - return ret; + return ret; break; case GIMPLE_OMP_SINGLE: ret = walk_tree (gimple_omp_single_clauses_ptr (stmt), callback_op, wi, - pset); + pset); if (ret) - return ret; + return ret; break; case GIMPLE_OMP_ATOMIC_LOAD: ret = walk_tree (gimple_omp_atomic_load_lhs_ptr (stmt), callback_op, wi, - pset); + pset); if (ret) - return ret; + return ret; ret = walk_tree (gimple_omp_atomic_load_rhs_ptr (stmt), callback_op, wi, - pset); + pset); if (ret) - return ret; + return ret; break; case GIMPLE_OMP_ATOMIC_STORE: ret = walk_tree (gimple_omp_atomic_store_val_ptr (stmt), callback_op, - wi, pset); + wi, pset); if (ret) - return ret; + return ret; break; /* Tuples that do not have operands. */ @@ -1593,15 +1587,15 @@ default: { - enum gimple_statement_structure_enum gss; - gss = gimple_statement_structure (stmt); - if (gss == GSS_WITH_OPS || gss == GSS_WITH_MEM_OPS) - for (i = 0; i < gimple_num_ops (stmt); i++) - { - ret = walk_tree (gimple_op_ptr (stmt, i), callback_op, wi, pset); - if (ret) - return ret; - } + enum gimple_statement_structure_enum gss; + gss = gimple_statement_structure (stmt); + if (gss == GSS_WITH_OPS || gss == GSS_WITH_MEM_OPS) + for (i = 0; i < gimple_num_ops (stmt); i++) + { + ret = walk_tree (gimple_op_ptr (stmt, i), callback_op, wi, pset); + if (ret) + return ret; + } } break; } @@ -1627,7 +1621,7 @@ tree walk_gimple_stmt (gimple_stmt_iterator *gsi, walk_stmt_fn callback_stmt, - walk_tree_fn callback_op, struct walk_stmt_info *wi) + walk_tree_fn callback_op, struct walk_stmt_info *wi) { gimple ret; tree tree_ret; @@ -1648,10 +1642,10 @@ bool handled_ops = false; tree_ret = callback_stmt (gsi, &handled_ops, wi); if (handled_ops) - return tree_ret; + return tree_ret; /* If CALLBACK_STMT did not handle operands, it should not have - a value to return. */ + a value to return. */ gcc_assert (tree_ret == NULL); /* Re-read stmt in case the callback changed it. */ @@ -1663,7 +1657,7 @@ { tree_ret = walk_gimple_op (stmt, callback_op, wi); if (tree_ret) - return tree_ret; + return tree_ret; } /* If STMT can have statements inside (e.g. GIMPLE_BIND), walk them. */ @@ -1671,42 +1665,42 @@ { case GIMPLE_BIND: ret = walk_gimple_seq (gimple_bind_body (stmt), callback_stmt, - callback_op, wi); + callback_op, wi); if (ret) - return wi->callback_result; + return wi->callback_result; break; case GIMPLE_CATCH: ret = walk_gimple_seq (gimple_catch_handler (stmt), callback_stmt, - callback_op, wi); + callback_op, wi); if (ret) - return wi->callback_result; + return wi->callback_result; break; case GIMPLE_EH_FILTER: ret = walk_gimple_seq (gimple_eh_filter_failure (stmt), callback_stmt, - callback_op, wi); + callback_op, wi); if (ret) - return wi->callback_result; + return wi->callback_result; break; case GIMPLE_TRY: ret = walk_gimple_seq (gimple_try_eval (stmt), callback_stmt, callback_op, - wi); + wi); if (ret) - return wi->callback_result; + return wi->callback_result; ret = walk_gimple_seq (gimple_try_cleanup (stmt), callback_stmt, - callback_op, wi); + callback_op, wi); if (ret) - return wi->callback_result; + return wi->callback_result; break; case GIMPLE_OMP_FOR: ret = walk_gimple_seq (gimple_omp_for_pre_body (stmt), callback_stmt, - callback_op, wi); + callback_op, wi); if (ret) - return wi->callback_result; + return wi->callback_result; /* FALL THROUGH. */ case GIMPLE_OMP_CRITICAL: @@ -1718,16 +1712,16 @@ case GIMPLE_OMP_SECTIONS: case GIMPLE_OMP_SINGLE: ret = walk_gimple_seq (gimple_omp_body (stmt), callback_stmt, callback_op, - wi); + wi); if (ret) - return wi->callback_result; + return wi->callback_result; break; case GIMPLE_WITH_CLEANUP_EXPR: ret = walk_gimple_seq (gimple_wce_cleanup (stmt), callback_stmt, - callback_op, wi); + callback_op, wi); if (ret) - return wi->callback_result; + return wi->callback_result; break; default: @@ -1748,8 +1742,8 @@ if (fn == NULL) { /* If FNDECL still does not have a function structure associated - with it, then it does not make sense for it to receive a - GIMPLE body. */ + with it, then it does not make sense for it to receive a + GIMPLE body. */ gcc_assert (seq == NULL); } else @@ -1794,9 +1788,9 @@ { t = TREE_TYPE (gimple_call_fn (stmt)); if (t && TREE_CODE (t) == POINTER_TYPE) - flags = flags_from_decl_or_type (TREE_TYPE (t)); + flags = flags_from_decl_or_type (TREE_TYPE (t)); else - flags = 0; + flags = 0; } if (stmt->gsbase.subcode & GF_CALL_NOTHROW) @@ -1944,17 +1938,17 @@ t = gimple_label_label (stmt); uid = LABEL_DECL_UID (t); if (uid == -1) - { - unsigned old_len = VEC_length (basic_block, label_to_block_map); - LABEL_DECL_UID (t) = uid = cfun->cfg->last_label_uid++; - if (old_len <= (unsigned) uid) - { - unsigned new_len = 3 * uid / 2 + 1; - - VEC_safe_grow_cleared (basic_block, gc, label_to_block_map, - new_len); - } - } + { + unsigned old_len = VEC_length (basic_block, label_to_block_map); + LABEL_DECL_UID (t) = uid = cfun->cfg->last_label_uid++; + if (old_len <= (unsigned) uid) + { + unsigned new_len = 3 * uid / 2 + 1; + + VEC_safe_grow_cleared (basic_block, gc, label_to_block_map, + new_len); + } + } VEC_replace (basic_block, label_to_block_map, uid, bb); } @@ -2012,7 +2006,7 @@ stmt = new_stmt; /* The LHS needs to be reset as this also changes the SSA name - on the LHS. */ + on the LHS. */ gimple_assign_set_lhs (stmt, lhs); } @@ -2228,20 +2222,20 @@ if (num_ops > 0) { for (i = 0; i < num_ops; i++) - gimple_set_op (copy, i, unshare_expr (gimple_op (stmt, i))); + gimple_set_op (copy, i, unshare_expr (gimple_op (stmt, i))); /* Clear out SSA operand vectors on COPY. */ if (gimple_has_ops (stmt)) - { - gimple_set_def_ops (copy, NULL); - gimple_set_use_ops (copy, NULL); - } + { + gimple_set_def_ops (copy, NULL); + gimple_set_use_ops (copy, NULL); + } if (gimple_has_mem_ops (stmt)) - { - gimple_set_vdef (copy, gimple_vdef (stmt)); - gimple_set_vuse (copy, gimple_vuse (stmt)); - } + { + gimple_set_vdef (copy, gimple_vdef (stmt)); + gimple_set_vuse (copy, gimple_vuse (stmt)); + } /* SSA operands need to be updated. */ gimple_set_modified (copy, true); @@ -2262,10 +2256,10 @@ s->gsbase.modified = (unsigned) modifiedp; if (modifiedp - && cfun->gimple_df - && is_gimple_call (s) - && gimple_call_noreturn_p (s)) - VEC_safe_push (gimple, gc, MODIFIED_NORETURN_CALLS (cfun), s); + && cfun->gimple_df + && is_gimple_call (s) + && gimple_call_noreturn_p (s)) + VEC_safe_push (gimple, gc, MODIFIED_NORETURN_CALLS (cfun), s); } } @@ -2297,36 +2291,36 @@ if (!(gimple_call_flags (s) & (ECF_CONST | ECF_PURE))) return true; else if (gimple_call_flags (s) & ECF_LOOPING_CONST_OR_PURE) - /* An infinite loop is considered a side effect. */ - return true; + /* An infinite loop is considered a side effect. */ + return true; if (gimple_call_lhs (s) && TREE_SIDE_EFFECTS (gimple_call_lhs (s))) - { - gcc_assert (gimple_has_volatile_ops (s)); - return true; - } + { + gcc_assert (gimple_has_volatile_ops (s)); + return true; + } if (TREE_SIDE_EFFECTS (gimple_call_fn (s))) return true; for (i = 0; i < nargs; i++) if (TREE_SIDE_EFFECTS (gimple_call_arg (s, i))) - { - gcc_assert (gimple_has_volatile_ops (s)); - return true; - } + { + gcc_assert (gimple_has_volatile_ops (s)); + return true; + } return false; } else { for (i = 0; i < gimple_num_ops (s); i++) - if (TREE_SIDE_EFFECTS (gimple_op (s, i))) - { - gcc_assert (gimple_has_volatile_ops (s)); - return true; - } + if (TREE_SIDE_EFFECTS (gimple_op (s, i))) + { + gcc_assert (gimple_has_volatile_ops (s)); + return true; + } } return false; @@ -2354,10 +2348,10 @@ because we must ignore a volatile LHS. */ if (TREE_SIDE_EFFECTS (gimple_call_fn (s)) || TREE_THIS_VOLATILE (gimple_call_fn (s))) - { - gcc_assert (gimple_has_volatile_ops (s)); - return true; - } + { + gcc_assert (gimple_has_volatile_ops (s)); + return true; + } for (i = 0; i < nargs; i++) if (TREE_SIDE_EFFECTS (gimple_call_arg (s, i)) @@ -2370,12 +2364,12 @@ { /* Skip the first operand, the LHS. */ for (i = 1; i < gimple_num_ops (s); i++) - if (TREE_SIDE_EFFECTS (gimple_op (s, i)) + if (TREE_SIDE_EFFECTS (gimple_op (s, i)) || TREE_THIS_VOLATILE (gimple_op (s, i))) - { - gcc_assert (gimple_has_volatile_ops (s)); - return true; - } + { + gcc_assert (gimple_has_volatile_ops (s)); + return true; + } } else if (is_gimple_debug (s)) return false; @@ -2383,12 +2377,12 @@ { /* For statements without an LHS, examine all arguments. */ for (i = 0; i < gimple_num_ops (s); i++) - if (TREE_SIDE_EFFECTS (gimple_op (s, i)) + if (TREE_SIDE_EFFECTS (gimple_op (s, i)) || TREE_THIS_VOLATILE (gimple_op (s, i))) - { - gcc_assert (gimple_has_volatile_ops (s)); - return true; - } + { + gcc_assert (gimple_has_volatile_ops (s)); + return true; + } } return false; @@ -2423,18 +2417,18 @@ t = gimple_call_fndecl (s); /* Assume that calls to weak functions may trap. */ if (!t || !DECL_P (t) || DECL_WEAK (t)) - return true; + return true; return false; case GIMPLE_ASSIGN: t = gimple_expr_type (s); op = gimple_assign_rhs_code (s); if (get_gimple_rhs_class (op) == GIMPLE_BINARY_RHS) - div = gimple_assign_rhs2 (s); + div = gimple_assign_rhs2 (s); return (operation_could_trap_p (op, FLOAT_TYPE_P (t), - (INTEGRAL_TYPE_P (t) - && TYPE_OVERFLOW_TRAPS (t)), - div)); + (INTEGRAL_TYPE_P (t) + && TYPE_OVERFLOW_TRAPS (t)), + div)); default: break; @@ -2475,7 +2469,7 @@ for (i = 0; i < (int) gimple_alloc_kind_all; ++i) { fprintf (stderr, "%-20s %7d %10d\n", gimple_alloc_kind_names[i], - gimple_alloc_counts[i], gimple_alloc_sizes[i]); + gimple_alloc_counts[i], gimple_alloc_sizes[i]); total_tuples += gimple_alloc_counts[i]; total_bytes += gimple_alloc_sizes[i]; } @@ -2575,10 +2569,10 @@ is_gimple_lvalue (tree t) { return (is_gimple_addressable (t) - || TREE_CODE (t) == WITH_SIZE_EXPR - /* These are complex lvalues, but don't have addresses, so they - go here. */ - || TREE_CODE (t) == BIT_FIELD_REF); + || TREE_CODE (t) == WITH_SIZE_EXPR + /* These are complex lvalues, but don't have addresses, so they + go here. */ + || TREE_CODE (t) == BIT_FIELD_REF); } /* Return true if T is a GIMPLE condition. */ @@ -2587,9 +2581,9 @@ is_gimple_condexpr (tree t) { return (is_gimple_val (t) || (COMPARISON_CLASS_P (t) - && !tree_could_trap_p (t) - && is_gimple_val (TREE_OPERAND (t, 0)) - && is_gimple_val (TREE_OPERAND (t, 1)))); + && !tree_could_trap_p (t) + && is_gimple_val (TREE_OPERAND (t, 0)) + && is_gimple_val (TREE_OPERAND (t, 1)))); } /* Return true if T is something whose address can be taken. */ @@ -2619,9 +2613,9 @@ /* Vector constant constructors are gimple invariant. */ case CONSTRUCTOR: if (TREE_TYPE (t) && TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE) - return TREE_CONSTANT (t); + return TREE_CONSTANT (t); else - return false; + return false; default: return false; @@ -2642,9 +2636,9 @@ while (handled_component_p (op)) { if ((TREE_CODE (op) == ARRAY_REF - || TREE_CODE (op) == ARRAY_RANGE_REF) - && !is_gimple_val (TREE_OPERAND (op, 1))) - return false; + || TREE_CODE (op) == ARRAY_RANGE_REF) + && !is_gimple_val (TREE_OPERAND (op, 1))) + return false; op = TREE_OPERAND (op, 0); } @@ -2676,22 +2670,22 @@ while (handled_component_p (op)) { switch (TREE_CODE (op)) - { - case ARRAY_REF: - case ARRAY_RANGE_REF: - if (!is_gimple_constant (TREE_OPERAND (op, 1)) - || TREE_OPERAND (op, 2) != NULL_TREE - || TREE_OPERAND (op, 3) != NULL_TREE) - return NULL; - break; - - case COMPONENT_REF: - if (TREE_OPERAND (op, 2) != NULL_TREE) - return NULL; - break; - - default:; - } + { + case ARRAY_REF: + case ARRAY_RANGE_REF: + if (!is_gimple_constant (TREE_OPERAND (op, 1)) + || TREE_OPERAND (op, 2) != NULL_TREE + || TREE_OPERAND (op, 3) != NULL_TREE) + return NULL; + break; + + case COMPONENT_REF: + if (TREE_OPERAND (op, 2) != NULL_TREE) + return NULL; + break; + + default:; + } op = TREE_OPERAND (op, 0); } @@ -2821,9 +2815,9 @@ is_gimple_variable (tree t) { return (TREE_CODE (t) == VAR_DECL - || TREE_CODE (t) == PARM_DECL - || TREE_CODE (t) == RESULT_DECL - || TREE_CODE (t) == SSA_NAME); + || TREE_CODE (t) == PARM_DECL + || TREE_CODE (t) == RESULT_DECL + || TREE_CODE (t) == SSA_NAME); } /* Return true if T is a GIMPLE identifier (something with an address). */ @@ -2832,11 +2826,11 @@ is_gimple_id (tree t) { return (is_gimple_variable (t) - || TREE_CODE (t) == FUNCTION_DECL - || TREE_CODE (t) == LABEL_DECL - || TREE_CODE (t) == CONST_DECL - /* Allow string constants, since they are addressable. */ - || TREE_CODE (t) == STRING_CST); + || TREE_CODE (t) == FUNCTION_DECL + || TREE_CODE (t) == LABEL_DECL + || TREE_CODE (t) == CONST_DECL + /* Allow string constants, since they are addressable. */ + || TREE_CODE (t) == STRING_CST); } /* Return true if TYPE is a suitable type for a scalar register variable. */ @@ -3019,21 +3013,21 @@ { case tcc_expression: switch (code) - { - case INIT_EXPR: - case MODIFY_EXPR: - case VA_ARG_EXPR: - case PREDECREMENT_EXPR: - case PREINCREMENT_EXPR: - case POSTDECREMENT_EXPR: - case POSTINCREMENT_EXPR: - /* All of these have side-effects, no matter what their - operands are. */ - return; - - default: - break; - } + { + case INIT_EXPR: + case MODIFY_EXPR: + case VA_ARG_EXPR: + case PREDECREMENT_EXPR: + case PREINCREMENT_EXPR: + case POSTDECREMENT_EXPR: + case POSTINCREMENT_EXPR: + /* All of these have side-effects, no matter what their + operands are. */ + return; + + default: + break; + } /* Fall through. */ case tcc_comparison: /* a comparison expression */ @@ -3043,11 +3037,11 @@ case tcc_vl_exp: /* a function call */ TREE_SIDE_EFFECTS (t) = TREE_THIS_VOLATILE (t); for (i = 0; i < len; ++i) - { - tree op = TREE_OPERAND (t, i); - if (op && TREE_SIDE_EFFECTS (op)) - TREE_SIDE_EFFECTS (t) = 1; - } + { + tree op = TREE_OPERAND (t, i); + if (op && TREE_SIDE_EFFECTS (op)) + TREE_SIDE_EFFECTS (t) = 1; + } break; case tcc_constant: @@ -3077,24 +3071,24 @@ { tree top0 = TREE_OPERAND (t, 0); t = build2 (NE_EXPR, TREE_TYPE (t), - top0, build_int_cst (TREE_TYPE (top0), 0)); + top0, build_int_cst (TREE_TYPE (top0), 0)); } /* For !x use x == 0. */ else if (TREE_CODE (t) == TRUTH_NOT_EXPR) { tree top0 = TREE_OPERAND (t, 0); t = build2 (EQ_EXPR, TREE_TYPE (t), - top0, build_int_cst (TREE_TYPE (top0), 0)); + top0, build_int_cst (TREE_TYPE (top0), 0)); } /* For cmp ? 1 : 0 use cmp. */ else if (TREE_CODE (t) == COND_EXPR - && COMPARISON_CLASS_P (TREE_OPERAND (t, 0)) - && integer_onep (TREE_OPERAND (t, 1)) - && integer_zerop (TREE_OPERAND (t, 2))) + && COMPARISON_CLASS_P (TREE_OPERAND (t, 0)) + && integer_onep (TREE_OPERAND (t, 1)) + && integer_zerop (TREE_OPERAND (t, 2))) { tree top0 = TREE_OPERAND (t, 0); t = build2 (TREE_CODE (top0), TREE_TYPE (t), - TREE_OPERAND (top0, 0), TREE_OPERAND (top0, 1)); + TREE_OPERAND (top0, 0), TREE_OPERAND (top0, 1)); } if (is_gimple_condexpr (t)) @@ -3132,11 +3126,9 @@ gimple_set_location (new_stmt, gimple_location (stmt)); gimple_call_copy_flags (new_stmt, stmt); gimple_call_set_chain (new_stmt, gimple_call_chain (stmt)); -#ifndef noCbC - gimple_call_set_cbc_goto (new_stmt, gimple_call_cbc_goto_p (stmt)); -#endif gimple_set_modified (new_stmt, true); + return new_stmt; } @@ -3174,7 +3166,7 @@ hashval_t val1 = pair->uid1; hashval_t val2 = pair->uid2; return (iterative_hash_hashval_t (val2, val1) - ^ iterative_hash_hashval_t (val1, val2)); + ^ iterative_hash_hashval_t (val1, val2)); } /* Compare two type pairs pointed-to by P1 and P2. */ @@ -3185,7 +3177,7 @@ const struct type_pair_d *pair1 = (const struct type_pair_d *) p1; const struct type_pair_d *pair2 = (const struct type_pair_d *) p2; return ((pair1->uid1 == pair2->uid1 && pair1->uid2 == pair2->uid2) - || (pair1->uid1 == pair2->uid2 && pair1->uid2 == pair2->uid1)); + || (pair1->uid1 == pair2->uid2 && pair1->uid2 == pair2->uid1)); } /* Lookup the pair of types T1 and T2 in *VISITED_P. Insert a new @@ -3291,8 +3283,8 @@ { name1 = DECL_NAME (name1); if (for_completion_p - && !name1) - return false; + && !name1) + return false; } gcc_assert (!name1 || TREE_CODE (name1) == IDENTIFIER_NODE); @@ -3300,8 +3292,8 @@ { name2 = DECL_NAME (name2); if (for_completion_p - && !name2) - return false; + && !name2) + return false; } gcc_assert (!name2 || TREE_CODE (name2) == IDENTIFIER_NODE); @@ -3353,12 +3345,12 @@ unsigned HOST_WIDE_INT bit_offset1, bit_offset2; bit_offset1 = TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (f1)); byte_offset1 = (TREE_INT_CST_LOW (DECL_FIELD_OFFSET (f1)) - + bit_offset1 / BITS_PER_UNIT); + + bit_offset1 / BITS_PER_UNIT); bit_offset2 = TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (f2)); byte_offset2 = (TREE_INT_CST_LOW (DECL_FIELD_OFFSET (f2)) - + bit_offset2 / BITS_PER_UNIT); + + bit_offset2 / BITS_PER_UNIT); if (byte_offset1 != byte_offset2) - return false; + return false; return bit_offset1 % BITS_PER_UNIT == bit_offset2 % BITS_PER_UNIT; } @@ -3453,7 +3445,7 @@ || TREE_CODE (t1) == OFFSET_TYPE) { /* Can't be the same type if they have different alignment, - sign, precision or mode. */ + sign, precision or mode. */ if (TYPE_ALIGN (t1) != TYPE_ALIGN (t2) || TYPE_PRECISION (t1) != TYPE_PRECISION (t2) || TYPE_MODE (t1) != TYPE_MODE (t2) @@ -3694,70 +3686,70 @@ case INTEGER_TYPE: case BOOLEAN_TYPE: { - tree min1 = TYPE_MIN_VALUE (t1); - tree max1 = TYPE_MAX_VALUE (t1); - tree min2 = TYPE_MIN_VALUE (t2); - tree max2 = TYPE_MAX_VALUE (t2); - bool min_equal_p = false; - bool max_equal_p = false; - - /* If either type has a minimum value, the other type must - have the same. */ - if (min1 == NULL_TREE && min2 == NULL_TREE) - min_equal_p = true; - else if (min1 && min2 && operand_equal_p (min1, min2, 0)) - min_equal_p = true; - - /* Likewise, if either type has a maximum value, the other - type must have the same. */ - if (max1 == NULL_TREE && max2 == NULL_TREE) - max_equal_p = true; - else if (max1 && max2 && operand_equal_p (max1, max2, 0)) - max_equal_p = true; - - if (!min_equal_p || !max_equal_p) - goto different_types; - - goto same_types; + tree min1 = TYPE_MIN_VALUE (t1); + tree max1 = TYPE_MAX_VALUE (t1); + tree min2 = TYPE_MIN_VALUE (t2); + tree max2 = TYPE_MAX_VALUE (t2); + bool min_equal_p = false; + bool max_equal_p = false; + + /* If either type has a minimum value, the other type must + have the same. */ + if (min1 == NULL_TREE && min2 == NULL_TREE) + min_equal_p = true; + else if (min1 && min2 && operand_equal_p (min1, min2, 0)) + min_equal_p = true; + + /* Likewise, if either type has a maximum value, the other + type must have the same. */ + if (max1 == NULL_TREE && max2 == NULL_TREE) + max_equal_p = true; + else if (max1 && max2 && operand_equal_p (max1, max2, 0)) + max_equal_p = true; + + if (!min_equal_p || !max_equal_p) + goto different_types; + + goto same_types; } case ENUMERAL_TYPE: { - /* FIXME lto, we cannot check bounds on enumeral types because - different front ends will produce different values. - In C, enumeral types are integers, while in C++ each element - will have its own symbolic value. We should decide how enums - are to be represented in GIMPLE and have each front end lower - to that. */ - tree v1, v2; - - /* For enumeral types, all the values must be the same. */ - if (TYPE_VALUES (t1) == TYPE_VALUES (t2)) - goto same_types; - - for (v1 = TYPE_VALUES (t1), v2 = TYPE_VALUES (t2); - v1 && v2; - v1 = TREE_CHAIN (v1), v2 = TREE_CHAIN (v2)) - { - tree c1 = TREE_VALUE (v1); - tree c2 = TREE_VALUE (v2); - - if (TREE_CODE (c1) == CONST_DECL) - c1 = DECL_INITIAL (c1); - - if (TREE_CODE (c2) == CONST_DECL) - c2 = DECL_INITIAL (c2); - - if (tree_int_cst_equal (c1, c2) != 1) - goto different_types; - } - - /* If one enumeration has more values than the other, they - are not the same. */ - if (v1 || v2) - goto different_types; - - goto same_types; + /* FIXME lto, we cannot check bounds on enumeral types because + different front ends will produce different values. + In C, enumeral types are integers, while in C++ each element + will have its own symbolic value. We should decide how enums + are to be represented in GIMPLE and have each front end lower + to that. */ + tree v1, v2; + + /* For enumeral types, all the values must be the same. */ + if (TYPE_VALUES (t1) == TYPE_VALUES (t2)) + goto same_types; + + for (v1 = TYPE_VALUES (t1), v2 = TYPE_VALUES (t2); + v1 && v2; + v1 = TREE_CHAIN (v1), v2 = TREE_CHAIN (v2)) + { + tree c1 = TREE_VALUE (v1); + tree c2 = TREE_VALUE (v2); + + if (TREE_CODE (c1) == CONST_DECL) + c1 = DECL_INITIAL (c1); + + if (TREE_CODE (c2) == CONST_DECL) + c2 = DECL_INITIAL (c2); + + if (tree_int_cst_equal (c1, c2) != 1) + goto different_types; + } + + /* If one enumeration has more values than the other, they + are not the same. */ + if (v1 || v2) + goto different_types; + + goto same_types; } case RECORD_TYPE: @@ -3988,14 +3980,14 @@ sccstack, sccstate, sccstate_obstack, mode); if (!cstate) - cstate = (struct sccs *)* pointer_map_contains (sccstate, t); + cstate = (struct sccs *)* pointer_map_contains (sccstate, t); state->low = MIN (state->low, cstate->low); /* If the type is no longer on the SCC stack and thus is not part of the parents SCC mix in its hash value. Otherwise we will - ignore the type for hashing purposes and return the unaltered - hash value. */ + ignore the type for hashing purposes and return the unaltered + hash value. */ if (!cstate->on_sccstack) - return tem; + return tem; } if (cstate->dfsnum < state->dfsnum && cstate->on_sccstack) @@ -4327,49 +4319,49 @@ gcc_assert (TREE_ADDRESSABLE (t) == TREE_ADDRESSABLE (new_type)); /* If t is not its main variant then make t unreachable from its - main variant list. Otherwise we'd queue up a lot of duplicates - there. */ + main variant list. Otherwise we'd queue up a lot of duplicates + there. */ if (t != TYPE_MAIN_VARIANT (t)) - { - tree tem = TYPE_MAIN_VARIANT (t); - while (tem && TYPE_NEXT_VARIANT (tem) != t) - tem = TYPE_NEXT_VARIANT (tem); - if (tem) - TYPE_NEXT_VARIANT (tem) = TYPE_NEXT_VARIANT (t); - TYPE_NEXT_VARIANT (t) = NULL_TREE; - } + { + tree tem = TYPE_MAIN_VARIANT (t); + while (tem && TYPE_NEXT_VARIANT (tem) != t) + tem = TYPE_NEXT_VARIANT (tem); + if (tem) + TYPE_NEXT_VARIANT (tem) = TYPE_NEXT_VARIANT (t); + TYPE_NEXT_VARIANT (t) = NULL_TREE; + } /* If we are a pointer then remove us from the pointer-to or - reference-to chain. Otherwise we'd queue up a lot of duplicates - there. */ + reference-to chain. Otherwise we'd queue up a lot of duplicates + there. */ if (TREE_CODE (t) == POINTER_TYPE) - { - if (TYPE_POINTER_TO (TREE_TYPE (t)) == t) - TYPE_POINTER_TO (TREE_TYPE (t)) = TYPE_NEXT_PTR_TO (t); - else - { - tree tem = TYPE_POINTER_TO (TREE_TYPE (t)); - while (tem && TYPE_NEXT_PTR_TO (tem) != t) - tem = TYPE_NEXT_PTR_TO (tem); - if (tem) - TYPE_NEXT_PTR_TO (tem) = TYPE_NEXT_PTR_TO (t); - } - TYPE_NEXT_PTR_TO (t) = NULL_TREE; - } + { + if (TYPE_POINTER_TO (TREE_TYPE (t)) == t) + TYPE_POINTER_TO (TREE_TYPE (t)) = TYPE_NEXT_PTR_TO (t); + else + { + tree tem = TYPE_POINTER_TO (TREE_TYPE (t)); + while (tem && TYPE_NEXT_PTR_TO (tem) != t) + tem = TYPE_NEXT_PTR_TO (tem); + if (tem) + TYPE_NEXT_PTR_TO (tem) = TYPE_NEXT_PTR_TO (t); + } + TYPE_NEXT_PTR_TO (t) = NULL_TREE; + } else if (TREE_CODE (t) == REFERENCE_TYPE) - { - if (TYPE_REFERENCE_TO (TREE_TYPE (t)) == t) - TYPE_REFERENCE_TO (TREE_TYPE (t)) = TYPE_NEXT_REF_TO (t); - else - { - tree tem = TYPE_REFERENCE_TO (TREE_TYPE (t)); - while (tem && TYPE_NEXT_REF_TO (tem) != t) - tem = TYPE_NEXT_REF_TO (tem); - if (tem) - TYPE_NEXT_REF_TO (tem) = TYPE_NEXT_REF_TO (t); - } - TYPE_NEXT_REF_TO (t) = NULL_TREE; - } + { + if (TYPE_REFERENCE_TO (TREE_TYPE (t)) == t) + TYPE_REFERENCE_TO (TREE_TYPE (t)) = TYPE_NEXT_REF_TO (t); + else + { + tree tem = TYPE_REFERENCE_TO (TREE_TYPE (t)); + while (tem && TYPE_NEXT_REF_TO (tem) != t) + tem = TYPE_NEXT_REF_TO (tem); + if (tem) + TYPE_NEXT_REF_TO (tem) = TYPE_NEXT_REF_TO (t); + } + TYPE_NEXT_REF_TO (t) = NULL_TREE; + } leader->type = t; leader->leader = new_type; @@ -4472,12 +4464,12 @@ { if (gimple_types) fprintf (stderr, "GIMPLE type table: size %ld, %ld elements, " - "%ld searches, %ld collisions (ratio: %f)\n", - (long) htab_size (gimple_types), - (long) htab_elements (gimple_types), - (long) gimple_types->searches, - (long) gimple_types->collisions, - htab_collisions (gimple_types)); + "%ld searches, %ld collisions (ratio: %f)\n", + (long) htab_size (gimple_types), + (long) htab_elements (gimple_types), + (long) gimple_types->searches, + (long) gimple_types->collisions, + htab_collisions (gimple_types)); else fprintf (stderr, "GIMPLE type table is empty\n"); if (type_hash_cache) @@ -4512,12 +4504,12 @@ fprintf (stderr, "GIMPLE canonical type hash table is empty\n"); if (gtc_visited) fprintf (stderr, "GIMPLE type comparison table: size %ld, %ld " - "elements, %ld searches, %ld collisions (ratio: %f)\n", - (long) htab_size (gtc_visited), - (long) htab_elements (gtc_visited), - (long) gtc_visited->searches, - (long) gtc_visited->collisions, - htab_collisions (gtc_visited)); + "elements, %ld searches, %ld collisions (ratio: %f)\n", + (long) htab_size (gtc_visited), + (long) htab_elements (gtc_visited), + (long) gtc_visited->searches, + (long) gtc_visited->collisions, + htab_collisions (gtc_visited)); else fprintf (stderr, "GIMPLE type comparison table is empty\n"); } @@ -4602,53 +4594,53 @@ if (type1 == intQI_type_node || type1 == unsigned_intQI_type_node) return unsignedp ? unsigned_intQI_type_node : intQI_type_node; -#define GIMPLE_FIXED_TYPES(NAME) \ +#define GIMPLE_FIXED_TYPES(NAME) \ if (type1 == short_ ## NAME ## _type_node \ || type1 == unsigned_short_ ## NAME ## _type_node) \ return unsignedp ? unsigned_short_ ## NAME ## _type_node \ - : short_ ## NAME ## _type_node; \ + : short_ ## NAME ## _type_node; \ if (type1 == NAME ## _type_node \ || type1 == unsigned_ ## NAME ## _type_node) \ return unsignedp ? unsigned_ ## NAME ## _type_node \ - : NAME ## _type_node; \ + : NAME ## _type_node; \ if (type1 == long_ ## NAME ## _type_node \ || type1 == unsigned_long_ ## NAME ## _type_node) \ return unsignedp ? unsigned_long_ ## NAME ## _type_node \ - : long_ ## NAME ## _type_node; \ + : long_ ## NAME ## _type_node; \ if (type1 == long_long_ ## NAME ## _type_node \ || type1 == unsigned_long_long_ ## NAME ## _type_node) \ return unsignedp ? unsigned_long_long_ ## NAME ## _type_node \ - : long_long_ ## NAME ## _type_node; + : long_long_ ## NAME ## _type_node; #define GIMPLE_FIXED_MODE_TYPES(NAME) \ if (type1 == NAME ## _type_node \ || type1 == u ## NAME ## _type_node) \ return unsignedp ? u ## NAME ## _type_node \ - : NAME ## _type_node; + : NAME ## _type_node; #define GIMPLE_FIXED_TYPES_SAT(NAME) \ if (type1 == sat_ ## short_ ## NAME ## _type_node \ || type1 == sat_ ## unsigned_short_ ## NAME ## _type_node) \ return unsignedp ? sat_ ## unsigned_short_ ## NAME ## _type_node \ - : sat_ ## short_ ## NAME ## _type_node; \ + : sat_ ## short_ ## NAME ## _type_node; \ if (type1 == sat_ ## NAME ## _type_node \ || type1 == sat_ ## unsigned_ ## NAME ## _type_node) \ return unsignedp ? sat_ ## unsigned_ ## NAME ## _type_node \ - : sat_ ## NAME ## _type_node; \ + : sat_ ## NAME ## _type_node; \ if (type1 == sat_ ## long_ ## NAME ## _type_node \ || type1 == sat_ ## unsigned_long_ ## NAME ## _type_node) \ return unsignedp ? sat_ ## unsigned_long_ ## NAME ## _type_node \ - : sat_ ## long_ ## NAME ## _type_node; \ + : sat_ ## long_ ## NAME ## _type_node; \ if (type1 == sat_ ## long_long_ ## NAME ## _type_node \ || type1 == sat_ ## unsigned_long_long_ ## NAME ## _type_node) \ return unsignedp ? sat_ ## unsigned_long_long_ ## NAME ## _type_node \ - : sat_ ## long_long_ ## NAME ## _type_node; - -#define GIMPLE_FIXED_MODE_TYPES_SAT(NAME) \ + : sat_ ## long_long_ ## NAME ## _type_node; + +#define GIMPLE_FIXED_MODE_TYPES_SAT(NAME) \ if (type1 == sat_ ## NAME ## _type_node \ || type1 == sat_ ## u ## NAME ## _type_node) \ return unsignedp ? sat_ ## u ## NAME ## _type_node \ - : sat_ ## NAME ## _type_node; + : sat_ ## NAME ## _type_node; GIMPLE_FIXED_TYPES (fract); GIMPLE_FIXED_TYPES_SAT (fract); @@ -4686,8 +4678,8 @@ || TYPE_UNSIGNED (type) == unsignedp) return type; -#define TYPE_OK(node) \ - (TYPE_MODE (type) == TYPE_MODE (node) \ +#define TYPE_OK(node) \ + (TYPE_MODE (type) == TYPE_MODE (node) \ && TYPE_PRECISION (type) == TYPE_PRECISION (node)) if (TYPE_OK (signed_char_type_node)) return unsignedp ? unsigned_char_type_node : signed_char_type_node; @@ -4765,7 +4757,7 @@ TREE_CODE (u) == COMPONENT_REF || TREE_CODE (u) == ARRAY_REF; u = TREE_OPERAND (u, 0)) if (TREE_CODE (u) == COMPONENT_REF - && TREE_CODE (TREE_TYPE (TREE_OPERAND (u, 0))) == UNION_TYPE) + && TREE_CODE (TREE_TYPE (TREE_OPERAND (u, 0))) == UNION_TYPE) return 0; /* That's all the expressions we handle specially. */ @@ -4788,7 +4780,7 @@ /* t1 == t can happen for boolean nodes which are always unsigned. */ if (t1 != t) - return get_alias_set (t1); + return get_alias_set (t1); } return -1; @@ -4825,9 +4817,9 @@ if (TREE_CODE (*tp) == MEM_REF && TREE_OPERAND (*tp, 0) == count_p->ptr) { if (wi_p->is_lhs) - count_p->num_stores++; + count_p->num_stores++; else - count_p->num_loads++; + count_p->num_loads++; } return NULL_TREE; @@ -4841,7 +4833,7 @@ void count_uses_and_derefs (tree ptr, gimple stmt, unsigned *num_uses_p, - unsigned *num_loads_p, unsigned *num_stores_p) + unsigned *num_loads_p, unsigned *num_stores_p) { ssa_op_iter i; tree use; @@ -4910,9 +4902,9 @@ bool walk_stmt_load_store_addr_ops (gimple stmt, void *data, - bool (*visit_load)(gimple, tree, void *), - bool (*visit_store)(gimple, tree, void *), - bool (*visit_addr)(gimple, tree, void *)) + bool (*visit_load)(gimple, tree, void *), + bool (*visit_store)(gimple, tree, void *), + bool (*visit_addr)(gimple, tree, void *)) { bool ret = false; unsigned i; @@ -4920,14 +4912,14 @@ { tree lhs, rhs; if (visit_store) - { - lhs = get_base_loadstore (gimple_assign_lhs (stmt)); - if (lhs) - ret |= visit_store (stmt, lhs, data); - } + { + lhs = get_base_loadstore (gimple_assign_lhs (stmt)); + if (lhs) + ret |= visit_store (stmt, lhs, data); + } rhs = gimple_assign_rhs1 (stmt); while (handled_component_p (rhs)) - rhs = TREE_OPERAND (rhs, 0); + rhs = TREE_OPERAND (rhs, 0); if (visit_addr) { if (TREE_CODE (rhs) == ADDR_EXPR) @@ -4943,59 +4935,59 @@ if (TREE_CODE (lhs) == TARGET_MEM_REF && TREE_CODE (TMR_BASE (lhs)) == ADDR_EXPR) ret |= visit_addr (stmt, TREE_OPERAND (TMR_BASE (lhs), 0), data); - } + } if (visit_load) - { - rhs = get_base_loadstore (rhs); - if (rhs) - ret |= visit_load (stmt, rhs, data); - } + { + rhs = get_base_loadstore (rhs); + if (rhs) + ret |= visit_load (stmt, rhs, data); + } } else if (visit_addr - && (is_gimple_assign (stmt) - || gimple_code (stmt) == GIMPLE_COND)) + && (is_gimple_assign (stmt) + || gimple_code (stmt) == GIMPLE_COND)) { for (i = 0; i < gimple_num_ops (stmt); ++i) - if (gimple_op (stmt, i) - && TREE_CODE (gimple_op (stmt, i)) == ADDR_EXPR) - ret |= visit_addr (stmt, TREE_OPERAND (gimple_op (stmt, i), 0), data); + if (gimple_op (stmt, i) + && TREE_CODE (gimple_op (stmt, i)) == ADDR_EXPR) + ret |= visit_addr (stmt, TREE_OPERAND (gimple_op (stmt, i), 0), data); } else if (is_gimple_call (stmt)) { if (visit_store) - { - tree lhs = gimple_call_lhs (stmt); - if (lhs) - { - lhs = get_base_loadstore (lhs); - if (lhs) - ret |= visit_store (stmt, lhs, data); - } - } + { + tree lhs = gimple_call_lhs (stmt); + if (lhs) + { + lhs = get_base_loadstore (lhs); + if (lhs) + ret |= visit_store (stmt, lhs, data); + } + } if (visit_load || visit_addr) - for (i = 0; i < gimple_call_num_args (stmt); ++i) - { - tree rhs = gimple_call_arg (stmt, i); - if (visit_addr - && TREE_CODE (rhs) == ADDR_EXPR) - ret |= visit_addr (stmt, TREE_OPERAND (rhs, 0), data); - else if (visit_load) - { - rhs = get_base_loadstore (rhs); - if (rhs) - ret |= visit_load (stmt, rhs, data); - } - } + for (i = 0; i < gimple_call_num_args (stmt); ++i) + { + tree rhs = gimple_call_arg (stmt, i); + if (visit_addr + && TREE_CODE (rhs) == ADDR_EXPR) + ret |= visit_addr (stmt, TREE_OPERAND (rhs, 0), data); + else if (visit_load) + { + rhs = get_base_loadstore (rhs); + if (rhs) + ret |= visit_load (stmt, rhs, data); + } + } if (visit_addr - && gimple_call_chain (stmt) - && TREE_CODE (gimple_call_chain (stmt)) == ADDR_EXPR) - ret |= visit_addr (stmt, TREE_OPERAND (gimple_call_chain (stmt), 0), - data); + && gimple_call_chain (stmt) + && TREE_CODE (gimple_call_chain (stmt)) == ADDR_EXPR) + ret |= visit_addr (stmt, TREE_OPERAND (gimple_call_chain (stmt), 0), + data); if (visit_addr - && gimple_call_return_slot_opt_p (stmt) - && gimple_call_lhs (stmt) != NULL_TREE - && TREE_ADDRESSABLE (TREE_TYPE (gimple_call_lhs (stmt)))) - ret |= visit_addr (stmt, gimple_call_lhs (stmt), data); + && gimple_call_return_slot_opt_p (stmt) + && gimple_call_lhs (stmt) != NULL_TREE + && TREE_ADDRESSABLE (TREE_TYPE (gimple_call_lhs (stmt)))) + ret |= visit_addr (stmt, gimple_call_lhs (stmt), data); } else if (gimple_code (stmt) == GIMPLE_ASM) { @@ -5006,77 +4998,77 @@ noutputs = gimple_asm_noutputs (stmt); oconstraints = XALLOCAVEC (const char *, noutputs); if (visit_store || visit_addr) - for (i = 0; i < gimple_asm_noutputs (stmt); ++i) - { - tree link = gimple_asm_output_op (stmt, i); - tree op = get_base_loadstore (TREE_VALUE (link)); - if (op && visit_store) - ret |= visit_store (stmt, op, data); - if (visit_addr) - { - constraint = TREE_STRING_POINTER - (TREE_VALUE (TREE_PURPOSE (link))); - oconstraints[i] = constraint; - parse_output_constraint (&constraint, i, 0, 0, &allows_mem, - &allows_reg, &is_inout); - if (op && !allows_reg && allows_mem) - ret |= visit_addr (stmt, op, data); - } - } + for (i = 0; i < gimple_asm_noutputs (stmt); ++i) + { + tree link = gimple_asm_output_op (stmt, i); + tree op = get_base_loadstore (TREE_VALUE (link)); + if (op && visit_store) + ret |= visit_store (stmt, op, data); + if (visit_addr) + { + constraint = TREE_STRING_POINTER + (TREE_VALUE (TREE_PURPOSE (link))); + oconstraints[i] = constraint; + parse_output_constraint (&constraint, i, 0, 0, &allows_mem, + &allows_reg, &is_inout); + if (op && !allows_reg && allows_mem) + ret |= visit_addr (stmt, op, data); + } + } if (visit_load || visit_addr) - for (i = 0; i < gimple_asm_ninputs (stmt); ++i) - { - tree link = gimple_asm_input_op (stmt, i); - tree op = TREE_VALUE (link); - if (visit_addr - && TREE_CODE (op) == ADDR_EXPR) - ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data); - else if (visit_load || visit_addr) - { - op = get_base_loadstore (op); - if (op) - { - if (visit_load) - ret |= visit_load (stmt, op, data); - if (visit_addr) - { - constraint = TREE_STRING_POINTER - (TREE_VALUE (TREE_PURPOSE (link))); - parse_input_constraint (&constraint, 0, 0, noutputs, - 0, oconstraints, - &allows_mem, &allows_reg); - if (!allows_reg && allows_mem) - ret |= visit_addr (stmt, op, data); - } - } - } - } + for (i = 0; i < gimple_asm_ninputs (stmt); ++i) + { + tree link = gimple_asm_input_op (stmt, i); + tree op = TREE_VALUE (link); + if (visit_addr + && TREE_CODE (op) == ADDR_EXPR) + ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data); + else if (visit_load || visit_addr) + { + op = get_base_loadstore (op); + if (op) + { + if (visit_load) + ret |= visit_load (stmt, op, data); + if (visit_addr) + { + constraint = TREE_STRING_POINTER + (TREE_VALUE (TREE_PURPOSE (link))); + parse_input_constraint (&constraint, 0, 0, noutputs, + 0, oconstraints, + &allows_mem, &allows_reg); + if (!allows_reg && allows_mem) + ret |= visit_addr (stmt, op, data); + } + } + } + } } else if (gimple_code (stmt) == GIMPLE_RETURN) { tree op = gimple_return_retval (stmt); if (op) - { - if (visit_addr - && TREE_CODE (op) == ADDR_EXPR) - ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data); - else if (visit_load) - { - op = get_base_loadstore (op); - if (op) - ret |= visit_load (stmt, op, data); - } - } + { + if (visit_addr + && TREE_CODE (op) == ADDR_EXPR) + ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data); + else if (visit_load) + { + op = get_base_loadstore (op); + if (op) + ret |= visit_load (stmt, op, data); + } + } } else if (visit_addr - && gimple_code (stmt) == GIMPLE_PHI) + && gimple_code (stmt) == GIMPLE_PHI) { for (i = 0; i < gimple_phi_num_args (stmt); ++i) - { - tree op = PHI_ARG_DEF (stmt, i); - if (TREE_CODE (op) == ADDR_EXPR) - ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data); - } + { + tree op = PHI_ARG_DEF (stmt, i); + if (TREE_CODE (op) == ADDR_EXPR) + ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data); + } } return ret; @@ -5087,18 +5079,18 @@ bool walk_stmt_load_store_ops (gimple stmt, void *data, - bool (*visit_load)(gimple, tree, void *), - bool (*visit_store)(gimple, tree, void *)) + bool (*visit_load)(gimple, tree, void *), + bool (*visit_store)(gimple, tree, void *)) { return walk_stmt_load_store_addr_ops (stmt, data, - visit_load, visit_store, NULL); + visit_load, visit_store, NULL); } /* Helper for gimple_ior_addresses_taken_1. */ static bool gimple_ior_addresses_taken_1 (gimple stmt ATTRIBUTE_UNUSED, - tree addr, void *data) + tree addr, void *data) { bitmap addresses_taken = (bitmap)data; addr = get_base_address (addr); @@ -5119,7 +5111,7 @@ gimple_ior_addresses_taken (bitmap addresses_taken, gimple stmt) { return walk_stmt_load_store_addr_ops (stmt, addresses_taken, NULL, NULL, - gimple_ior_addresses_taken_1); + gimple_ior_addresses_taken_1); } @@ -5137,14 +5129,14 @@ int dmgl_opts = DMGL_NO_OPTS; if (verbosity >= 2) - { - dmgl_opts = DMGL_VERBOSE - | DMGL_ANSI - | DMGL_GNU_V3 - | DMGL_RET_POSTFIX; - if (TREE_CODE (decl) == FUNCTION_DECL) - dmgl_opts |= DMGL_PARAMS; - } + { + dmgl_opts = DMGL_VERBOSE + | DMGL_ANSI + | DMGL_GNU_V3 + | DMGL_RET_POSTFIX; + if (TREE_CODE (decl) == FUNCTION_DECL) + dmgl_opts |= DMGL_PARAMS; + } mangled_str = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); str = cplus_demangle_v3 (mangled_str, dmgl_opts);