Lines 708-713
solution_set_add (bitmap set, unsigned H
Link Here
|
708 |
bitmap result = BITMAP_ALLOC (&iteration_obstack); |
708 |
bitmap result = BITMAP_ALLOC (&iteration_obstack); |
709 |
unsigned int i; |
709 |
unsigned int i; |
710 |
bitmap_iterator bi; |
710 |
bitmap_iterator bi; |
|
|
711 |
unsigned HOST_WIDE_INT min = -1, max = 0; |
712 |
|
713 |
/* Compute set of vars we can reach from set + offset. */ |
714 |
|
715 |
EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi) |
716 |
{ |
717 |
if (get_varinfo (i)->is_artificial_var |
718 |
|| get_varinfo (i)->has_union |
719 |
|| get_varinfo (i)->is_unknown_size_var) |
720 |
continue; |
721 |
|
722 |
if (get_varinfo (i)->offset + offset < min) |
723 |
min = get_varinfo (i)->offset + offset; |
724 |
if (get_varinfo (i)->offset + get_varinfo (i)->size + offset > max) |
725 |
{ |
726 |
max = get_varinfo (i)->offset + get_varinfo (i)->size + offset; |
727 |
if (max > get_varinfo (i)->fullsize) |
728 |
max = get_varinfo (i)->fullsize; |
729 |
} |
730 |
} |
711 |
|
731 |
|
712 |
EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi) |
732 |
EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi) |
713 |
{ |
733 |
{ |
Lines 715-727
solution_set_add (bitmap set, unsigned H
Link Here
|
715 |
less than end. Otherwise, it is globbed to a single |
735 |
less than end. Otherwise, it is globbed to a single |
716 |
variable. */ |
736 |
variable. */ |
717 |
|
737 |
|
718 |
if ((get_varinfo (i)->offset + offset) < get_varinfo (i)->fullsize) |
738 |
if (get_varinfo (i)->offset + get_varinfo (i)->size - 1 >= min |
|
|
739 |
&& get_varinfo (i)->offset < max) |
719 |
{ |
740 |
{ |
720 |
unsigned HOST_WIDE_INT fieldoffset = get_varinfo (i)->offset + offset; |
741 |
bitmap_set_bit (result, i); |
721 |
varinfo_t v = first_vi_for_offset (get_varinfo (i), fieldoffset); |
|
|
722 |
if (!v) |
723 |
continue; |
724 |
bitmap_set_bit (result, v->id); |
725 |
} |
742 |
} |
726 |
else if (get_varinfo (i)->is_artificial_var |
743 |
else if (get_varinfo (i)->is_artificial_var |
727 |
|| get_varinfo (i)->has_union |
744 |
|| get_varinfo (i)->has_union |
Lines 3258-3264
handle_ptr_arith (VEC (ce_s, heap) *lhsc
Link Here
|
3258 |
unsigned int i = 0; |
3275 |
unsigned int i = 0; |
3259 |
unsigned int j = 0; |
3276 |
unsigned int j = 0; |
3260 |
VEC (ce_s, heap) *temp = NULL; |
3277 |
VEC (ce_s, heap) *temp = NULL; |
3261 |
unsigned int rhsoffset = 0; |
3278 |
unsigned HOST_WIDE_INT rhsoffset = 0; |
3262 |
|
3279 |
|
3263 |
if (TREE_CODE (expr) != PLUS_EXPR |
3280 |
if (TREE_CODE (expr) != PLUS_EXPR |
3264 |
&& TREE_CODE (expr) != MINUS_EXPR) |
3281 |
&& TREE_CODE (expr) != MINUS_EXPR) |
Lines 3269-3277
handle_ptr_arith (VEC (ce_s, heap) *lhsc
Link Here
|
3269 |
|
3286 |
|
3270 |
get_constraint_for (op0, &temp); |
3287 |
get_constraint_for (op0, &temp); |
3271 |
if (POINTER_TYPE_P (TREE_TYPE (op0)) |
3288 |
if (POINTER_TYPE_P (TREE_TYPE (op0)) |
3272 |
&& TREE_CODE (op1) == INTEGER_CST |
3289 |
&& host_integerp (op1, 1) |
3273 |
&& TREE_CODE (expr) == PLUS_EXPR) |
3290 |
&& TREE_CODE (expr) == PLUS_EXPR) |
3274 |
{ |
3291 |
{ |
|
|
3292 |
if ((TREE_INT_CST_LOW (op1) * BITS_PER_UNIT) / BITS_PER_UNIT |
3293 |
!= TREE_INT_CST_LOW (op1)) |
3294 |
return false; |
3275 |
rhsoffset = TREE_INT_CST_LOW (op1) * BITS_PER_UNIT; |
3295 |
rhsoffset = TREE_INT_CST_LOW (op1) * BITS_PER_UNIT; |
3276 |
} |
3296 |
} |
3277 |
else |
3297 |
else |
Lines 3661-3666
push_fields_onto_fieldstack (tree type,
Link Here
|
3661 |
{ |
3681 |
{ |
3662 |
tree field; |
3682 |
tree field; |
3663 |
int count = 0; |
3683 |
int count = 0; |
|
|
3684 |
unsigned HOST_WIDE_INT minoffset = -1; |
3664 |
|
3685 |
|
3665 |
if (TREE_CODE (type) == COMPLEX_TYPE) |
3686 |
if (TREE_CODE (type) == COMPLEX_TYPE) |
3666 |
{ |
3687 |
{ |
Lines 3773-3780
push_fields_onto_fieldstack (tree type,
Link Here
|
3773 |
} |
3794 |
} |
3774 |
else |
3795 |
else |
3775 |
count += pushed; |
3796 |
count += pushed; |
|
|
3797 |
|
3798 |
if (bitpos_of_field (field) < minoffset) |
3799 |
minoffset = bitpos_of_field (field); |
3776 |
} |
3800 |
} |
3777 |
|
3801 |
|
|
|
3802 |
/* We need to create a fake subvar for empty bases. */ |
3803 |
if (minoffset != 0 && count != 0) |
3804 |
{ |
3805 |
fieldoff_s *pair; |
3806 |
|
3807 |
pair = VEC_safe_push (fieldoff_s, heap, *fieldstack, NULL); |
3808 |
pair->type = void_type_node; |
3809 |
pair->size = build_int_cst (size_type_node, minoffset); |
3810 |
pair->decl = NULL; |
3811 |
pair->offset = offset; |
3812 |
count++; |
3813 |
} |
3814 |
|
3778 |
return count; |
3815 |
return count; |
3779 |
} |
3816 |
} |
3780 |
|
3817 |
|