case COND_EXPR:
x = COND_EXPR_COND (t);
- if (TREE_CODE (TREE_TYPE (x)) != BOOLEAN_TYPE)
+ if (!INTEGRAL_TYPE_P (TREE_TYPE (x)))
{
- error ("non-boolean used in condition");
+ error ("non-integral used in condition");
return x;
}
if (!is_gimple_condexpr (x))
}
*walk_subtrees = 0;
break;
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ /* PLUS_EXPR and MINUS_EXPR don't work on pointers, they should be done using
+ POINTER_PLUS_EXPR. */
+ if (POINTER_TYPE_P (TREE_TYPE (t)))
+ {
+ error ("invalid operand to plus/minus, type is a pointer");
+ return t;
+ }
+ CHECK_OP (0, "invalid operand to binary operator");
+ CHECK_OP (1, "invalid operand to binary operator");
+ break;
+ case POINTER_PLUS_EXPR:
+ /* Check to make sure the first operand is a pointer or reference type. */
+ if (!POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (t, 0))))
+ {
+ error ("invalid operand to pointer plus, first operand is not a pointer");
+ return t;
+ }
+ /* Check to make sure the second operand is an integer with type of
+ sizetype. */
+ if (!useless_type_conversion_p (sizetype,
+ TREE_TYPE (TREE_OPERAND (t, 1))))
+ {
+ error ("invalid operand to pointer plus, second operand is not an "
+ "integer with type of sizetype.");
+ return t;
+ }
+ /* FALLTHROUGH */
case LT_EXPR:
case LE_EXPR:
case GT_EXPR:
case UNGE_EXPR:
case UNEQ_EXPR:
case LTGT_EXPR:
- case PLUS_EXPR:
- case MINUS_EXPR:
case MULT_EXPR:
case TRUNC_DIV_EXPR:
case CEIL_DIV_EXPR:
basic_block *region, unsigned n_region,
basic_block *region_copy)
{
- unsigned i, n_doms;
+ unsigned i;
bool free_region_copy = false, copying_header = false;
struct loop *loop = entry->dest->loop_father;
edge exit_copy;
- basic_block *doms;
+ VEC (basic_block, heap) *doms;
edge redirected;
int total_freq = 0, entry_freq = 0;
gcov_type total_count = 0, entry_count = 0;
/* Record blocks outside the region that are dominated by something
inside. */
- doms = XNEWVEC (basic_block, n_basic_blocks);
+ doms = NULL;
initialize_original_copy_tables ();
- n_doms = get_dominated_by_region (CDI_DOMINATORS, region, n_region, doms);
+ doms = get_dominated_by_region (CDI_DOMINATORS, region, n_region);
if (entry->dest->count)
{
region, but was dominated by something inside needs recounting as
well. */
set_immediate_dominator (CDI_DOMINATORS, entry->dest, entry->src);
- doms[n_doms++] = get_bb_original (entry->dest);
- iterate_fix_dominators (CDI_DOMINATORS, doms, n_doms);
+ VEC_safe_push (basic_block, heap, doms, get_bb_original (entry->dest));
+ iterate_fix_dominators (CDI_DOMINATORS, doms, false);
free (doms);
/* Add the other PHI node arguments. */
VEC_safe_push (basic_block, heap, bbs_to_fix_dom, dbb);
}
- iterate_fix_dominators (CDI_DOMINATORS,
- VEC_address (basic_block, bbs_to_fix_dom),
- VEC_length (basic_block, bbs_to_fix_dom));
+ iterate_fix_dominators (CDI_DOMINATORS, bbs_to_fix_dom, true);
BITMAP_FREE (df);
BITMAP_FREE (df_idom);