X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fgimple.h;h=97eec59fcb05e59b095119c11e67fbda0a8bd96a;hb=1ed4ec90e5645c88b9b1107d956e376244edd5e6;hp=8536c70e87e21bdc421cbf90026bb346cb701744;hpb=3c25489e88a7ea2937c19abff9163d9f7d8ca53a;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/gimple.h b/gcc/gimple.h index 8536c70e87e..97eec59fcb0 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -1,6 +1,6 @@ /* Gimple IR definitions. - Copyright 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. + Copyright 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. Contributed by Aldy Hernandez This file is part of GCC. @@ -97,14 +97,13 @@ enum gimple_rhs_class enum gf_mask { GF_ASM_INPUT = 1 << 0, GF_ASM_VOLATILE = 1 << 1, - GF_CALL_CANNOT_INLINE = 1 << 0, - GF_CALL_FROM_THUNK = 1 << 1, - GF_CALL_RETURN_SLOT_OPT = 1 << 2, - GF_CALL_TAILCALL = 1 << 3, - GF_CALL_VA_ARG_PACK = 1 << 4, - GF_CALL_NOTHROW = 1 << 5, - GF_CALL_ALLOCA_FOR_VAR = 1 << 6, - GF_CALL_INTERNAL = 1 << 7, + GF_CALL_FROM_THUNK = 1 << 0, + GF_CALL_RETURN_SLOT_OPT = 1 << 1, + GF_CALL_TAILCALL = 1 << 2, + GF_CALL_VA_ARG_PACK = 1 << 3, + GF_CALL_NOTHROW = 1 << 4, + GF_CALL_ALLOCA_FOR_VAR = 1 << 5, + GF_CALL_INTERNAL = 1 << 6, GF_OMP_PARALLEL_COMBINED = 1 << 0, /* True on an GIMPLE_OMP_RETURN statement if the return does not require @@ -227,7 +226,7 @@ void gimple_seq_add_stmt (gimple_seq *, gimple); similar to gimple_seq_add_stmt, but does not scan the operands. During gimplification, we need to manipulate statement sequences before the def/use vectors have been constructed. */ -void gimplify_seq_add_stmt (gimple_seq *, gimple); +void gimple_seq_add_stmt_without_update (gimple_seq *, gimple); /* Allocate a new sequence and initialize its first element with STMT. */ @@ -306,9 +305,6 @@ struct GTY(()) gimple_statement_base { /* Nonzero if this statement contains volatile operands. */ unsigned has_volatile_ops : 1; - /* Padding to get subcode to 16 bit alignment. */ - unsigned pad : 1; - /* The SUBCODE field can be used for tuple-specific flags for tuples that do not require subcodes. Note that SUBCODE should be at least as wide as tree codes, as several tuples store tree codes @@ -949,7 +945,6 @@ void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *, tree *); gimple gimple_build_cond_from_tree (tree, tree, tree); void gimple_cond_set_condition_from_tree (gimple, tree); bool gimple_has_side_effects (const_gimple); -bool gimple_rhs_has_side_effects (const_gimple); bool gimple_could_trap_p (gimple); bool gimple_could_trap_p_1 (gimple, bool, bool); bool gimple_assign_rhs_could_trap_p (gimple); @@ -965,8 +960,6 @@ tree gimple_extract_devirt_binfo_from_cst (tree); /* Returns true iff T is a valid GIMPLE statement. */ extern bool is_gimple_stmt (tree); -/* Returns true iff TYPE is a valid type for a scalar register variable. */ -extern bool is_gimple_reg_type (tree); /* Returns true iff T is a scalar register variable. */ extern bool is_gimple_reg (tree); /* Returns true iff T is any sort of variable. */ @@ -1008,9 +1001,6 @@ extern bool is_gimple_mem_rhs (tree); /* Returns true iff T is a valid if-statement condition. */ extern bool is_gimple_condexpr (tree); -/* Returns true iff T is a variable that does not need to live in memory. */ -extern bool is_gimple_non_addressable (tree t); - /* Returns true iff T is a valid call address expression. */ extern bool is_gimple_call_addr (tree); @@ -1033,6 +1023,7 @@ extern bool walk_stmt_load_store_ops (gimple, void *, bool (*)(gimple, tree, void *), bool (*)(gimple, tree, void *)); extern bool gimple_ior_addresses_taken (bitmap, gimple); +extern bool gimple_call_builtin_class_p (gimple, enum built_in_class); extern bool gimple_call_builtin_p (gimple, enum built_in_function); extern bool gimple_asm_clobbers_memory_p (const_gimple); @@ -1094,14 +1085,33 @@ struct gimplify_ctx bool save_stack; bool into_ssa; bool allow_rhs_cond_expr; + bool in_cleanup_point_expr; }; +/* Return true if gimplify_one_sizepos doesn't need to gimplify + expr (when in TYPE_SIZE{,_UNIT} and similar type/decl size/bitsize + fields). */ +static inline bool +is_gimple_sizepos (tree expr) +{ + /* gimplify_one_sizepos doesn't need to do anything if the value isn't there, + is constant, or contains A PLACEHOLDER_EXPR. We also don't want to do + anything if it's already a VAR_DECL. If it's a VAR_DECL from another + function, the gimplifier will want to replace it with a new variable, + but that will cause problems if this type is from outside the function. + It's OK to have that here. */ + return (expr == NULL_TREE + || TREE_CONSTANT (expr) + || TREE_CODE (expr) == VAR_DECL + || CONTAINS_PLACEHOLDER_P (expr)); +} + extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *, bool (*) (tree), fallback_t); extern void gimplify_type_sizes (tree, gimple_seq *); extern void gimplify_one_sizepos (tree *, gimple_seq *); extern bool gimplify_stmt (tree *, gimple_seq *); -extern gimple gimplify_body (tree *, tree, bool); +extern gimple gimplify_body (tree, bool); extern void push_gimplify_context (struct gimplify_ctx *); extern void pop_gimplify_context (gimple); extern void gimplify_and_add (tree, gimple_seq *); @@ -1126,6 +1136,7 @@ extern tree omp_reduction_init (tree, tree); /* In trans-mem.c. */ extern void diagnose_tm_safe_errors (tree); +extern void compute_transaction_bits (void); /* In tree-nested.c. */ extern void lower_nested_functions (tree); @@ -1590,6 +1601,21 @@ gimple_set_has_volatile_ops (gimple stmt, bool volatilep) stmt->gsbase.has_volatile_ops = (unsigned) volatilep; } +/* Return true if BB is in a transaction. */ + +static inline bool +block_in_transaction (basic_block bb) +{ + return flag_tm && bb->flags & BB_IN_TRANSACTION; +} + +/* Return true if STMT is in a transaction. */ + +static inline bool +gimple_in_transaction (gimple stmt) +{ + return block_in_transaction (gimple_bb (stmt)); +} /* Return true if statement STMT may access memory. */ @@ -2343,29 +2369,6 @@ gimple_call_tail_p (gimple s) } -/* Set the inlinable status of GIMPLE_CALL S to INLINABLE_P. */ - -static inline void -gimple_call_set_cannot_inline (gimple s, bool inlinable_p) -{ - GIMPLE_CHECK (s, GIMPLE_CALL); - if (inlinable_p) - s->gsbase.subcode |= GF_CALL_CANNOT_INLINE; - else - s->gsbase.subcode &= ~GF_CALL_CANNOT_INLINE; -} - - -/* Return true if GIMPLE_CALL S cannot be inlined. */ - -static inline bool -gimple_call_cannot_inline_p (gimple s) -{ - GIMPLE_CHECK (s, GIMPLE_CALL); - return (s->gsbase.subcode & GF_CALL_CANNOT_INLINE) != 0; -} - - /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return slot optimization. This transformation uses the target of the call expansion as the return slot for calls that return in memory. */ @@ -4865,6 +4868,13 @@ gimple_expr_type (const_gimple stmt) return void_type_node; } +/* Return true if TYPE is a suitable type for a scalar register variable. */ + +static inline bool +is_gimple_reg_type (tree type) +{ + return !AGGREGATE_TYPE_P (type); +} /* Return a new iterator pointing to GIMPLE_SEQ's first statement. */