Commit 2bc0a660 by Jan Hubicka Committed by Jan Hubicka

gimple.h (gcc_gimple_checking_assert): New macro.

	* gimple.h (gcc_gimple_checking_assert): New macro.
 	(gimple_set_def_ops, gimple_set_use_ops,
 	gimple_set_vuse, gimple_set_vdef,
 	gimple_omp_subcode, gimple_omp_set_subcode, gimple_ops, gimple_op,
 	gimple_op_ptr, gimple_op_ptr, gimple_set_op, gimple_bind_set_block,
 	gimple_asm_input_op, gimple_asm_input_op_ptr, gimple_asm_set_input_op,
 	gimple_asm_output_op, gimple_asm_output_op_ptr,
 	gimple_asm_set_output_op, gimple_asm_clobber_op, 
 	gimple_asm_set_clobber_op, gimple_asm_label_op,
 	gimple_asm_set_label_op, gimple_try_set_kind, gimple_try_catch_is_cleanup
 	gimple_try_set_catch_is_cleanup, gimple_phi_arg, 
 	gimple_switch_num_labels, gimple_switch_set_index, gimple_switch_label,
 	gimple_switch_set_label, gimple_omp_for_index, gimple_omp_for_index_ptr,
 	gimple_omp_for_set_index, gimple_omp_for_initial, gimple_omp_for_initial_ptr,
 	gimple_omp_for_set_initial, gimple_omp_for_final, gimple_omp_for_final_ptr,
 	gimple_omp_for_set_final, gimple_omp_for_incr, gimple_omp_for_incr_ptr,
 	gimple_omp_for_set_incr, gimple_omp_for_set_cond, gimple_omp_for_cond): Make
 	checking conditional with ENABLE_GIMPLE_CHECKING.
 	(gimple_phi_set_arg): Likewise; replace memcpy by assignment.

From-SVN: r160474
parent 6521ac85
2010-06-09 Jan Hubicka <jh@suse.cz>
* gimple.h (gcc_gimple_checking_assert): New macro.
(gimple_set_def_ops, gimple_set_use_ops,
gimple_set_vuse, gimple_set_vdef,
gimple_omp_subcode, gimple_omp_set_subcode, gimple_ops, gimple_op,
gimple_op_ptr, gimple_op_ptr, gimple_set_op, gimple_bind_set_block,
gimple_asm_input_op, gimple_asm_input_op_ptr, gimple_asm_set_input_op,
gimple_asm_output_op, gimple_asm_output_op_ptr,
gimple_asm_set_output_op, gimple_asm_clobber_op,
gimple_asm_set_clobber_op, gimple_asm_label_op,
gimple_asm_set_label_op, gimple_try_set_kind, gimple_try_catch_is_cleanup
gimple_try_set_catch_is_cleanup, gimple_phi_arg,
gimple_switch_num_labels, gimple_switch_set_index, gimple_switch_label,
gimple_switch_set_label, gimple_omp_for_index, gimple_omp_for_index_ptr,
gimple_omp_for_set_index, gimple_omp_for_initial, gimple_omp_for_initial_ptr,
gimple_omp_for_set_initial, gimple_omp_for_final, gimple_omp_for_final_ptr,
gimple_omp_for_set_final, gimple_omp_for_incr, gimple_omp_for_incr_ptr,
gimple_omp_for_set_incr, gimple_omp_for_set_cond, gimple_omp_for_cond): Make
checking conditional with ENABLE_GIMPLE_CHECKING.
(gimple_phi_set_arg): Likewise; replace memcpy by assignment.
2010-06-09 Sandra Loosemore <sandra@codesourcery.com> 2010-06-09 Sandra Loosemore <sandra@codesourcery.com>
* tree-ssa-loop-ivopts.c (adjust_setup_cost): New function. * tree-ssa-loop-ivopts.c (adjust_setup_cost): New function.
......
...@@ -51,6 +51,7 @@ extern const unsigned char gimple_rhs_class_table[]; ...@@ -51,6 +51,7 @@ extern const unsigned char gimple_rhs_class_table[];
/* Error out if a gimple tuple is addressed incorrectly. */ /* Error out if a gimple tuple is addressed incorrectly. */
#if defined ENABLE_GIMPLE_CHECKING #if defined ENABLE_GIMPLE_CHECKING
#define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
extern void gimple_check_failed (const_gimple, const char *, int, \ extern void gimple_check_failed (const_gimple, const char *, int, \
const char *, enum gimple_code, \ const char *, enum gimple_code, \
enum tree_code) ATTRIBUTE_NORETURN; enum tree_code) ATTRIBUTE_NORETURN;
...@@ -63,6 +64,7 @@ extern void gimple_check_failed (const_gimple, const char *, int, \ ...@@ -63,6 +64,7 @@ extern void gimple_check_failed (const_gimple, const char *, int, \
(CODE), ERROR_MARK); \ (CODE), ERROR_MARK); \
} while (0) } while (0)
#else /* not ENABLE_GIMPLE_CHECKING */ #else /* not ENABLE_GIMPLE_CHECKING */
#define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR)))
#define GIMPLE_CHECK(GS, CODE) (void)0 #define GIMPLE_CHECK(GS, CODE) (void)0
#endif #endif
...@@ -1084,9 +1086,7 @@ gimple_code (const_gimple g) ...@@ -1084,9 +1086,7 @@ gimple_code (const_gimple g)
static inline enum gimple_statement_structure_enum static inline enum gimple_statement_structure_enum
gss_for_code (enum gimple_code code) gss_for_code (enum gimple_code code)
{ {
#ifdef ENABLE_CHECKING gcc_gimple_checking_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE);
gcc_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE);
#endif
return gss_for_code_[code]; return gss_for_code_[code];
} }
...@@ -1326,7 +1326,7 @@ gimple_def_ops (const_gimple g) ...@@ -1326,7 +1326,7 @@ gimple_def_ops (const_gimple g)
static inline void static inline void
gimple_set_def_ops (gimple g, struct def_optype_d *def) gimple_set_def_ops (gimple g, struct def_optype_d *def)
{ {
gcc_assert (gimple_has_ops (g)); gcc_gimple_checking_assert (gimple_has_ops (g));
g->gsops.opbase.def_ops = def; g->gsops.opbase.def_ops = def;
} }
...@@ -1347,7 +1347,7 @@ gimple_use_ops (const_gimple g) ...@@ -1347,7 +1347,7 @@ gimple_use_ops (const_gimple g)
static inline void static inline void
gimple_set_use_ops (gimple g, struct use_optype_d *use) gimple_set_use_ops (gimple g, struct use_optype_d *use)
{ {
gcc_assert (gimple_has_ops (g)); gcc_gimple_checking_assert (gimple_has_ops (g));
g->gsops.opbase.use_ops = use; g->gsops.opbase.use_ops = use;
} }
...@@ -1428,7 +1428,7 @@ gimple_vdef_ptr (gimple g) ...@@ -1428,7 +1428,7 @@ gimple_vdef_ptr (gimple g)
static inline void static inline void
gimple_set_vuse (gimple g, tree vuse) gimple_set_vuse (gimple g, tree vuse)
{ {
gcc_assert (gimple_has_mem_ops (g)); gcc_gimple_checking_assert (gimple_has_mem_ops (g));
g->gsmembase.vuse = vuse; g->gsmembase.vuse = vuse;
} }
...@@ -1437,7 +1437,7 @@ gimple_set_vuse (gimple g, tree vuse) ...@@ -1437,7 +1437,7 @@ gimple_set_vuse (gimple g, tree vuse)
static inline void static inline void
gimple_set_vdef (gimple g, tree vdef) gimple_set_vdef (gimple g, tree vdef)
{ {
gcc_assert (gimple_has_mem_ops (g)); gcc_gimple_checking_assert (gimple_has_mem_ops (g));
g->gsmembase.vdef = vdef; g->gsmembase.vdef = vdef;
} }
...@@ -1528,7 +1528,7 @@ gimple_references_memory_p (gimple stmt) ...@@ -1528,7 +1528,7 @@ gimple_references_memory_p (gimple stmt)
static inline unsigned static inline unsigned
gimple_omp_subcode (const_gimple s) gimple_omp_subcode (const_gimple s)
{ {
gcc_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD gcc_gimple_checking_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD
&& gimple_code (s) <= GIMPLE_OMP_SINGLE); && gimple_code (s) <= GIMPLE_OMP_SINGLE);
return s->gsbase.subcode; return s->gsbase.subcode;
} }
...@@ -1540,7 +1540,7 @@ gimple_omp_set_subcode (gimple s, unsigned int subcode) ...@@ -1540,7 +1540,7 @@ gimple_omp_set_subcode (gimple s, unsigned int subcode)
{ {
/* We only have 16 bits for the subcode. Assert that we are not /* We only have 16 bits for the subcode. Assert that we are not
overflowing it. */ overflowing it. */
gcc_assert (subcode < (1 << 16)); gcc_gimple_checking_assert (subcode < (1 << 16));
s->gsbase.subcode = subcode; s->gsbase.subcode = subcode;
} }
...@@ -1640,7 +1640,7 @@ gimple_ops (gimple gs) ...@@ -1640,7 +1640,7 @@ gimple_ops (gimple gs)
of the structure. Note that those structures that do not of the structure. Note that those structures that do not
have an operand vector have a zero offset. */ have an operand vector have a zero offset. */
off = gimple_ops_offset_[gimple_statement_structure (gs)]; off = gimple_ops_offset_[gimple_statement_structure (gs)];
gcc_assert (off != 0); gcc_gimple_checking_assert (off != 0);
return (tree *) ((char *) gs + off); return (tree *) ((char *) gs + off);
} }
...@@ -1653,9 +1653,7 @@ gimple_op (const_gimple gs, unsigned i) ...@@ -1653,9 +1653,7 @@ gimple_op (const_gimple gs, unsigned i)
{ {
if (gimple_has_ops (gs)) if (gimple_has_ops (gs))
{ {
#ifdef ENABLE_CHECKING gcc_gimple_checking_assert (i < gimple_num_ops (gs));
gcc_assert (i < gimple_num_ops (gs));
#endif
return gimple_ops (CONST_CAST_GIMPLE (gs))[i]; return gimple_ops (CONST_CAST_GIMPLE (gs))[i];
} }
else else
...@@ -1669,9 +1667,7 @@ gimple_op_ptr (const_gimple gs, unsigned i) ...@@ -1669,9 +1667,7 @@ gimple_op_ptr (const_gimple gs, unsigned i)
{ {
if (gimple_has_ops (gs)) if (gimple_has_ops (gs))
{ {
#ifdef ENABLE_CHECKING gcc_gimple_checking_assert (i < gimple_num_ops (gs));
gcc_assert (i < gimple_num_ops (gs));
#endif
return gimple_ops (CONST_CAST_GIMPLE (gs)) + i; return gimple_ops (CONST_CAST_GIMPLE (gs)) + i;
} }
else else
...@@ -1683,7 +1679,7 @@ gimple_op_ptr (const_gimple gs, unsigned i) ...@@ -1683,7 +1679,7 @@ gimple_op_ptr (const_gimple gs, unsigned i)
static inline void static inline void
gimple_set_op (gimple gs, unsigned i, tree op) gimple_set_op (gimple gs, unsigned i, tree op)
{ {
gcc_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs)); gcc_gimple_checking_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs));
/* Note. It may be tempting to assert that OP matches /* Note. It may be tempting to assert that OP matches
is_gimple_operand, but that would be wrong. Different tuples is_gimple_operand, but that would be wrong. Different tuples
...@@ -2626,7 +2622,8 @@ static inline void ...@@ -2626,7 +2622,8 @@ static inline void
gimple_bind_set_block (gimple gs, tree block) gimple_bind_set_block (gimple gs, tree block)
{ {
GIMPLE_CHECK (gs, GIMPLE_BIND); GIMPLE_CHECK (gs, GIMPLE_BIND);
gcc_assert (block == NULL_TREE || TREE_CODE (block) == BLOCK); gcc_gimple_checking_assert (block == NULL_TREE
|| TREE_CODE (block) == BLOCK);
gs->gimple_bind.block = block; gs->gimple_bind.block = block;
} }
...@@ -2675,7 +2672,7 @@ static inline tree ...@@ -2675,7 +2672,7 @@ static inline tree
gimple_asm_input_op (const_gimple gs, unsigned index) gimple_asm_input_op (const_gimple gs, unsigned index)
{ {
GIMPLE_CHECK (gs, GIMPLE_ASM); GIMPLE_CHECK (gs, GIMPLE_ASM);
gcc_assert (index <= gs->gimple_asm.ni); gcc_gimple_checking_assert (index <= gs->gimple_asm.ni);
return gimple_op (gs, index); return gimple_op (gs, index);
} }
...@@ -2685,7 +2682,7 @@ static inline tree * ...@@ -2685,7 +2682,7 @@ static inline tree *
gimple_asm_input_op_ptr (const_gimple gs, unsigned index) gimple_asm_input_op_ptr (const_gimple gs, unsigned index)
{ {
GIMPLE_CHECK (gs, GIMPLE_ASM); GIMPLE_CHECK (gs, GIMPLE_ASM);
gcc_assert (index <= gs->gimple_asm.ni); gcc_gimple_checking_assert (index <= gs->gimple_asm.ni);
return gimple_op_ptr (gs, index); return gimple_op_ptr (gs, index);
} }
...@@ -2696,8 +2693,8 @@ static inline void ...@@ -2696,8 +2693,8 @@ static inline void
gimple_asm_set_input_op (gimple gs, unsigned index, tree in_op) gimple_asm_set_input_op (gimple gs, unsigned index, tree in_op)
{ {
GIMPLE_CHECK (gs, GIMPLE_ASM); GIMPLE_CHECK (gs, GIMPLE_ASM);
gcc_assert (index <= gs->gimple_asm.ni); gcc_gimple_checking_assert (index <= gs->gimple_asm.ni
gcc_assert (TREE_CODE (in_op) == TREE_LIST); && TREE_CODE (in_op) == TREE_LIST);
gimple_set_op (gs, index, in_op); gimple_set_op (gs, index, in_op);
} }
...@@ -2708,7 +2705,7 @@ static inline tree ...@@ -2708,7 +2705,7 @@ static inline tree
gimple_asm_output_op (const_gimple gs, unsigned index) gimple_asm_output_op (const_gimple gs, unsigned index)
{ {
GIMPLE_CHECK (gs, GIMPLE_ASM); GIMPLE_CHECK (gs, GIMPLE_ASM);
gcc_assert (index <= gs->gimple_asm.no); gcc_gimple_checking_assert (index <= gs->gimple_asm.no);
return gimple_op (gs, index + gs->gimple_asm.ni); return gimple_op (gs, index + gs->gimple_asm.ni);
} }
...@@ -2718,7 +2715,7 @@ static inline tree * ...@@ -2718,7 +2715,7 @@ static inline tree *
gimple_asm_output_op_ptr (const_gimple gs, unsigned index) gimple_asm_output_op_ptr (const_gimple gs, unsigned index)
{ {
GIMPLE_CHECK (gs, GIMPLE_ASM); GIMPLE_CHECK (gs, GIMPLE_ASM);
gcc_assert (index <= gs->gimple_asm.no); gcc_gimple_checking_assert (index <= gs->gimple_asm.no);
return gimple_op_ptr (gs, index + gs->gimple_asm.ni); return gimple_op_ptr (gs, index + gs->gimple_asm.ni);
} }
...@@ -2729,8 +2726,8 @@ static inline void ...@@ -2729,8 +2726,8 @@ static inline void
gimple_asm_set_output_op (gimple gs, unsigned index, tree out_op) gimple_asm_set_output_op (gimple gs, unsigned index, tree out_op)
{ {
GIMPLE_CHECK (gs, GIMPLE_ASM); GIMPLE_CHECK (gs, GIMPLE_ASM);
gcc_assert (index <= gs->gimple_asm.no); gcc_gimple_checking_assert (index <= gs->gimple_asm.no
gcc_assert (TREE_CODE (out_op) == TREE_LIST); && TREE_CODE (out_op) == TREE_LIST);
gimple_set_op (gs, index + gs->gimple_asm.ni, out_op); gimple_set_op (gs, index + gs->gimple_asm.ni, out_op);
} }
...@@ -2741,7 +2738,7 @@ static inline tree ...@@ -2741,7 +2738,7 @@ static inline tree
gimple_asm_clobber_op (const_gimple gs, unsigned index) gimple_asm_clobber_op (const_gimple gs, unsigned index)
{ {
GIMPLE_CHECK (gs, GIMPLE_ASM); GIMPLE_CHECK (gs, GIMPLE_ASM);
gcc_assert (index <= gs->gimple_asm.nc); gcc_gimple_checking_assert (index <= gs->gimple_asm.nc);
return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no); return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no);
} }
...@@ -2752,8 +2749,8 @@ static inline void ...@@ -2752,8 +2749,8 @@ static inline void
gimple_asm_set_clobber_op (gimple gs, unsigned index, tree clobber_op) gimple_asm_set_clobber_op (gimple gs, unsigned index, tree clobber_op)
{ {
GIMPLE_CHECK (gs, GIMPLE_ASM); GIMPLE_CHECK (gs, GIMPLE_ASM);
gcc_assert (index <= gs->gimple_asm.nc); gcc_gimple_checking_assert (index <= gs->gimple_asm.nc
gcc_assert (TREE_CODE (clobber_op) == TREE_LIST); && TREE_CODE (clobber_op) == TREE_LIST);
gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no, clobber_op); gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.no, clobber_op);
} }
...@@ -2763,7 +2760,7 @@ static inline tree ...@@ -2763,7 +2760,7 @@ static inline tree
gimple_asm_label_op (const_gimple gs, unsigned index) gimple_asm_label_op (const_gimple gs, unsigned index)
{ {
GIMPLE_CHECK (gs, GIMPLE_ASM); GIMPLE_CHECK (gs, GIMPLE_ASM);
gcc_assert (index <= gs->gimple_asm.nl); gcc_gimple_checking_assert (index <= gs->gimple_asm.nl);
return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc); return gimple_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc);
} }
...@@ -2773,8 +2770,8 @@ static inline void ...@@ -2773,8 +2770,8 @@ static inline void
gimple_asm_set_label_op (gimple gs, unsigned index, tree label_op) gimple_asm_set_label_op (gimple gs, unsigned index, tree label_op)
{ {
GIMPLE_CHECK (gs, GIMPLE_ASM); GIMPLE_CHECK (gs, GIMPLE_ASM);
gcc_assert (index <= gs->gimple_asm.nl); gcc_gimple_checking_assert (index <= gs->gimple_asm.nl
gcc_assert (TREE_CODE (label_op) == TREE_LIST); && TREE_CODE (label_op) == TREE_LIST);
gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc, label_op); gimple_set_op (gs, index + gs->gimple_asm.ni + gs->gimple_asm.nc, label_op);
} }
...@@ -2987,7 +2984,8 @@ static inline void ...@@ -2987,7 +2984,8 @@ static inline void
gimple_try_set_kind (gimple gs, enum gimple_try_flags kind) gimple_try_set_kind (gimple gs, enum gimple_try_flags kind)
{ {
GIMPLE_CHECK (gs, GIMPLE_TRY); GIMPLE_CHECK (gs, GIMPLE_TRY);
gcc_assert (kind == GIMPLE_TRY_CATCH || kind == GIMPLE_TRY_FINALLY); gcc_gimple_checking_assert (kind == GIMPLE_TRY_CATCH
|| kind == GIMPLE_TRY_FINALLY);
if (gimple_try_kind (gs) != kind) if (gimple_try_kind (gs) != kind)
gs->gsbase.subcode = (unsigned int) kind; gs->gsbase.subcode = (unsigned int) kind;
} }
...@@ -2998,7 +2996,7 @@ gimple_try_set_kind (gimple gs, enum gimple_try_flags kind) ...@@ -2998,7 +2996,7 @@ gimple_try_set_kind (gimple gs, enum gimple_try_flags kind)
static inline bool static inline bool
gimple_try_catch_is_cleanup (const_gimple gs) gimple_try_catch_is_cleanup (const_gimple gs)
{ {
gcc_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH); gcc_gimple_checking_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH);
return (gs->gsbase.subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0; return (gs->gsbase.subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
} }
...@@ -3029,7 +3027,7 @@ gimple_try_cleanup (gimple gs) ...@@ -3029,7 +3027,7 @@ gimple_try_cleanup (gimple gs)
static inline void static inline void
gimple_try_set_catch_is_cleanup (gimple g, bool catch_is_cleanup) gimple_try_set_catch_is_cleanup (gimple g, bool catch_is_cleanup)
{ {
gcc_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH); gcc_gimple_checking_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH);
if (catch_is_cleanup) if (catch_is_cleanup)
g->gsbase.subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP; g->gsbase.subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP;
else else
...@@ -3156,7 +3154,7 @@ static inline struct phi_arg_d * ...@@ -3156,7 +3154,7 @@ static inline struct phi_arg_d *
gimple_phi_arg (gimple gs, unsigned index) gimple_phi_arg (gimple gs, unsigned index)
{ {
GIMPLE_CHECK (gs, GIMPLE_PHI); GIMPLE_CHECK (gs, GIMPLE_PHI);
gcc_assert (index <= gs->gimple_phi.capacity); gcc_gimple_checking_assert (index <= gs->gimple_phi.capacity);
return &(gs->gimple_phi.args[index]); return &(gs->gimple_phi.args[index]);
} }
...@@ -3167,8 +3165,8 @@ static inline void ...@@ -3167,8 +3165,8 @@ static inline void
gimple_phi_set_arg (gimple gs, unsigned index, struct phi_arg_d * phiarg) gimple_phi_set_arg (gimple gs, unsigned index, struct phi_arg_d * phiarg)
{ {
GIMPLE_CHECK (gs, GIMPLE_PHI); GIMPLE_CHECK (gs, GIMPLE_PHI);
gcc_assert (index <= gs->gimple_phi.nargs); gcc_gimple_checking_assert (index <= gs->gimple_phi.nargs);
memcpy (gs->gimple_phi.args + index, phiarg, sizeof (struct phi_arg_d)); gs->gimple_phi.args[index] = *phiarg;
} }
/* Return the region number for GIMPLE_RESX GS. */ /* Return the region number for GIMPLE_RESX GS. */
...@@ -3215,7 +3213,7 @@ gimple_switch_num_labels (const_gimple gs) ...@@ -3215,7 +3213,7 @@ gimple_switch_num_labels (const_gimple gs)
unsigned num_ops; unsigned num_ops;
GIMPLE_CHECK (gs, GIMPLE_SWITCH); GIMPLE_CHECK (gs, GIMPLE_SWITCH);
num_ops = gimple_num_ops (gs); num_ops = gimple_num_ops (gs);
gcc_assert (num_ops > 1); gcc_gimple_checking_assert (num_ops > 1);
return num_ops - 1; return num_ops - 1;
} }
...@@ -3256,7 +3254,7 @@ static inline void ...@@ -3256,7 +3254,7 @@ static inline void
gimple_switch_set_index (gimple gs, tree index) gimple_switch_set_index (gimple gs, tree index)
{ {
GIMPLE_CHECK (gs, GIMPLE_SWITCH); GIMPLE_CHECK (gs, GIMPLE_SWITCH);
gcc_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index)); gcc_gimple_checking_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index));
gimple_set_op (gs, 0, index); gimple_set_op (gs, 0, index);
} }
...@@ -3268,7 +3266,7 @@ static inline tree ...@@ -3268,7 +3266,7 @@ static inline tree
gimple_switch_label (const_gimple gs, unsigned index) gimple_switch_label (const_gimple gs, unsigned index)
{ {
GIMPLE_CHECK (gs, GIMPLE_SWITCH); GIMPLE_CHECK (gs, GIMPLE_SWITCH);
gcc_assert (gimple_num_ops (gs) > index + 1); gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1);
return gimple_op (gs, index + 1); return gimple_op (gs, index + 1);
} }
...@@ -3278,8 +3276,9 @@ static inline void ...@@ -3278,8 +3276,9 @@ static inline void
gimple_switch_set_label (gimple gs, unsigned index, tree label) gimple_switch_set_label (gimple gs, unsigned index, tree label)
{ {
GIMPLE_CHECK (gs, GIMPLE_SWITCH); GIMPLE_CHECK (gs, GIMPLE_SWITCH);
gcc_assert (gimple_num_ops (gs) > index + 1); gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1
gcc_assert (label == NULL_TREE || TREE_CODE (label) == CASE_LABEL_EXPR); && (label == NULL_TREE
|| TREE_CODE (label) == CASE_LABEL_EXPR));
gimple_set_op (gs, index + 1, label); gimple_set_op (gs, index + 1, label);
} }
...@@ -3324,9 +3323,7 @@ static inline tree ...@@ -3324,9 +3323,7 @@ static inline tree
gimple_debug_bind_get_var (gimple dbg) gimple_debug_bind_get_var (gimple dbg)
{ {
GIMPLE_CHECK (dbg, GIMPLE_DEBUG); GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
#ifdef ENABLE_CHECKING gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
gcc_assert (gimple_debug_bind_p (dbg));
#endif
return gimple_op (dbg, 0); return gimple_op (dbg, 0);
} }
...@@ -3337,9 +3334,7 @@ static inline tree ...@@ -3337,9 +3334,7 @@ static inline tree
gimple_debug_bind_get_value (gimple dbg) gimple_debug_bind_get_value (gimple dbg)
{ {
GIMPLE_CHECK (dbg, GIMPLE_DEBUG); GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
#ifdef ENABLE_CHECKING gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
gcc_assert (gimple_debug_bind_p (dbg));
#endif
return gimple_op (dbg, 1); return gimple_op (dbg, 1);
} }
...@@ -3350,9 +3345,7 @@ static inline tree * ...@@ -3350,9 +3345,7 @@ static inline tree *
gimple_debug_bind_get_value_ptr (gimple dbg) gimple_debug_bind_get_value_ptr (gimple dbg)
{ {
GIMPLE_CHECK (dbg, GIMPLE_DEBUG); GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
#ifdef ENABLE_CHECKING gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
gcc_assert (gimple_debug_bind_p (dbg));
#endif
return gimple_op_ptr (dbg, 1); return gimple_op_ptr (dbg, 1);
} }
...@@ -3362,9 +3355,7 @@ static inline void ...@@ -3362,9 +3355,7 @@ static inline void
gimple_debug_bind_set_var (gimple dbg, tree var) gimple_debug_bind_set_var (gimple dbg, tree var)
{ {
GIMPLE_CHECK (dbg, GIMPLE_DEBUG); GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
#ifdef ENABLE_CHECKING gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
gcc_assert (gimple_debug_bind_p (dbg));
#endif
gimple_set_op (dbg, 0, var); gimple_set_op (dbg, 0, var);
} }
...@@ -3375,9 +3366,7 @@ static inline void ...@@ -3375,9 +3366,7 @@ static inline void
gimple_debug_bind_set_value (gimple dbg, tree value) gimple_debug_bind_set_value (gimple dbg, tree value)
{ {
GIMPLE_CHECK (dbg, GIMPLE_DEBUG); GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
#ifdef ENABLE_CHECKING gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
gcc_assert (gimple_debug_bind_p (dbg));
#endif
gimple_set_op (dbg, 1, value); gimple_set_op (dbg, 1, value);
} }
...@@ -3392,9 +3381,7 @@ static inline void ...@@ -3392,9 +3381,7 @@ static inline void
gimple_debug_bind_reset_value (gimple dbg) gimple_debug_bind_reset_value (gimple dbg)
{ {
GIMPLE_CHECK (dbg, GIMPLE_DEBUG); GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
#ifdef ENABLE_CHECKING gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
gcc_assert (gimple_debug_bind_p (dbg));
#endif
gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE); gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE);
} }
...@@ -3405,9 +3392,7 @@ static inline bool ...@@ -3405,9 +3392,7 @@ static inline bool
gimple_debug_bind_has_value_p (gimple dbg) gimple_debug_bind_has_value_p (gimple dbg)
{ {
GIMPLE_CHECK (dbg, GIMPLE_DEBUG); GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
#ifdef ENABLE_CHECKING gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
gcc_assert (gimple_debug_bind_p (dbg));
#endif
return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE; return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE;
} }
...@@ -3506,7 +3491,7 @@ static inline tree ...@@ -3506,7 +3491,7 @@ static inline tree
gimple_omp_for_index (const_gimple gs, size_t i) gimple_omp_for_index (const_gimple gs, size_t i)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (i < gs->gimple_omp_for.collapse); gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
return gs->gimple_omp_for.iter[i].index; return gs->gimple_omp_for.iter[i].index;
} }
...@@ -3517,7 +3502,7 @@ static inline tree * ...@@ -3517,7 +3502,7 @@ static inline tree *
gimple_omp_for_index_ptr (gimple gs, size_t i) gimple_omp_for_index_ptr (gimple gs, size_t i)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (i < gs->gimple_omp_for.collapse); gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
return &gs->gimple_omp_for.iter[i].index; return &gs->gimple_omp_for.iter[i].index;
} }
...@@ -3528,7 +3513,7 @@ static inline void ...@@ -3528,7 +3513,7 @@ static inline void
gimple_omp_for_set_index (gimple gs, size_t i, tree index) gimple_omp_for_set_index (gimple gs, size_t i, tree index)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (i < gs->gimple_omp_for.collapse); gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
gs->gimple_omp_for.iter[i].index = index; gs->gimple_omp_for.iter[i].index = index;
} }
...@@ -3539,7 +3524,7 @@ static inline tree ...@@ -3539,7 +3524,7 @@ static inline tree
gimple_omp_for_initial (const_gimple gs, size_t i) gimple_omp_for_initial (const_gimple gs, size_t i)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (i < gs->gimple_omp_for.collapse); gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
return gs->gimple_omp_for.iter[i].initial; return gs->gimple_omp_for.iter[i].initial;
} }
...@@ -3550,7 +3535,7 @@ static inline tree * ...@@ -3550,7 +3535,7 @@ static inline tree *
gimple_omp_for_initial_ptr (gimple gs, size_t i) gimple_omp_for_initial_ptr (gimple gs, size_t i)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (i < gs->gimple_omp_for.collapse); gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
return &gs->gimple_omp_for.iter[i].initial; return &gs->gimple_omp_for.iter[i].initial;
} }
...@@ -3561,7 +3546,7 @@ static inline void ...@@ -3561,7 +3546,7 @@ static inline void
gimple_omp_for_set_initial (gimple gs, size_t i, tree initial) gimple_omp_for_set_initial (gimple gs, size_t i, tree initial)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (i < gs->gimple_omp_for.collapse); gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
gs->gimple_omp_for.iter[i].initial = initial; gs->gimple_omp_for.iter[i].initial = initial;
} }
...@@ -3572,7 +3557,7 @@ static inline tree ...@@ -3572,7 +3557,7 @@ static inline tree
gimple_omp_for_final (const_gimple gs, size_t i) gimple_omp_for_final (const_gimple gs, size_t i)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (i < gs->gimple_omp_for.collapse); gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
return gs->gimple_omp_for.iter[i].final; return gs->gimple_omp_for.iter[i].final;
} }
...@@ -3583,7 +3568,7 @@ static inline tree * ...@@ -3583,7 +3568,7 @@ static inline tree *
gimple_omp_for_final_ptr (gimple gs, size_t i) gimple_omp_for_final_ptr (gimple gs, size_t i)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (i < gs->gimple_omp_for.collapse); gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
return &gs->gimple_omp_for.iter[i].final; return &gs->gimple_omp_for.iter[i].final;
} }
...@@ -3594,7 +3579,7 @@ static inline void ...@@ -3594,7 +3579,7 @@ static inline void
gimple_omp_for_set_final (gimple gs, size_t i, tree final) gimple_omp_for_set_final (gimple gs, size_t i, tree final)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (i < gs->gimple_omp_for.collapse); gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
gs->gimple_omp_for.iter[i].final = final; gs->gimple_omp_for.iter[i].final = final;
} }
...@@ -3605,7 +3590,7 @@ static inline tree ...@@ -3605,7 +3590,7 @@ static inline tree
gimple_omp_for_incr (const_gimple gs, size_t i) gimple_omp_for_incr (const_gimple gs, size_t i)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (i < gs->gimple_omp_for.collapse); gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
return gs->gimple_omp_for.iter[i].incr; return gs->gimple_omp_for.iter[i].incr;
} }
...@@ -3616,7 +3601,7 @@ static inline tree * ...@@ -3616,7 +3601,7 @@ static inline tree *
gimple_omp_for_incr_ptr (gimple gs, size_t i) gimple_omp_for_incr_ptr (gimple gs, size_t i)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (i < gs->gimple_omp_for.collapse); gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
return &gs->gimple_omp_for.iter[i].incr; return &gs->gimple_omp_for.iter[i].incr;
} }
...@@ -3627,7 +3612,7 @@ static inline void ...@@ -3627,7 +3612,7 @@ static inline void
gimple_omp_for_set_incr (gimple gs, size_t i, tree incr) gimple_omp_for_set_incr (gimple gs, size_t i, tree incr)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (i < gs->gimple_omp_for.collapse); gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
gs->gimple_omp_for.iter[i].incr = incr; gs->gimple_omp_for.iter[i].incr = incr;
} }
...@@ -4129,8 +4114,8 @@ static inline void ...@@ -4129,8 +4114,8 @@ static inline void
gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond) gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (TREE_CODE_CLASS (cond) == tcc_comparison); gcc_gimple_checking_assert (TREE_CODE_CLASS (cond) == tcc_comparison
gcc_assert (i < gs->gimple_omp_for.collapse); && i < gs->gimple_omp_for.collapse);
gs->gimple_omp_for.iter[i].cond = cond; gs->gimple_omp_for.iter[i].cond = cond;
} }
...@@ -4141,7 +4126,7 @@ static inline enum tree_code ...@@ -4141,7 +4126,7 @@ static inline enum tree_code
gimple_omp_for_cond (const_gimple gs, size_t i) gimple_omp_for_cond (const_gimple gs, size_t i)
{ {
GIMPLE_CHECK (gs, GIMPLE_OMP_FOR); GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
gcc_assert (i < gs->gimple_omp_for.collapse); gcc_gimple_checking_assert (i < gs->gimple_omp_for.collapse);
return gs->gimple_omp_for.iter[i].cond; return gs->gimple_omp_for.iter[i].cond;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment