summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-02 11:22:31 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-02 11:22:31 +0000
commit85d86b55bfb790e3079c4ab50b5eac3bff212bf0 (patch)
tree3260d223788c7f661eef298b55f74eb6033bc7f0 /gcc/tree-ssa-ccp.c
parent8b3fb720f80336b39a0312ea95a79e7ab7fbcea3 (diff)
downloadgcc-85d86b55bfb790e3079c4ab50b5eac3bff212bf0.tar.gz
2012-05-02 Richard Guenther <rguenther@suse.de>
* tree.c (valid_constant_size_p): New function. * tree.h (valid_constant_size_p): Declare. * cfgexpand.c (expand_one_var): Adjust check for too large variables by using valid_constant_size_p. * varasm.c (assemble_variable): Likewise. c/ * c-decl.c (grokdeclarator): Properly check for sizes that cover more than half of the address-space. cp/ * decl.c (grokdeclarator): Properly check for sizes that cover more than half of the address-space. 2012-05-02 Richard Guenther <rguenther@suse.de> * fold-const.c (div_if_zero_remainder): sizetypes no longer sign-extend. (int_const_binop_1): New worker for int_const_binop with overflowable parameter. Pass it through to force_fit_type_double. (int_const_binop): Wrap around int_const_binop_1 with overflowable equal to one. (size_binop_loc): Call int_const_binop_1 with overflowable equal to minus one, forcing overflow detection for even unsigned types. (extract_muldiv_1): Remove bogus TYPE_IS_SIZETYPE special-casing. (fold_binary_loc): Call try_move_mult_to_index with signed offset. * stor-layout.c (initialize_sizetypes): sizetypes no longer sign-extend. (layout_type): For zero-sized arrays ignore overflow on the size calculations. * tree-ssa-ccp.c (bit_value_unop_1): Likewise. (bit_value_binop_1): Likewise. * tree.c (double_int_to_tree): Likewise. (double_int_fits_to_tree_p): Likewise. (force_fit_type_double): Likewise. (host_integerp): Likewise. (int_fits_type_p): Likewise. * varasm.c (output_constructor_regular_field): Sign-extend the field-offset to cater for negative offsets produced by the Ada frontend. * omp-low.c (extract_omp_for_data): Convert the loop step to signed for pointer adjustments. * g++.dg/tree-ssa/pr19807.C: Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187042 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 4e86b8db0c3..1257b8bf7ba 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -1101,14 +1101,12 @@ bit_value_unop_1 (enum tree_code code, tree type,
bool uns;
/* First extend mask and value according to the original type. */
- uns = (TREE_CODE (rtype) == INTEGER_TYPE && TYPE_IS_SIZETYPE (rtype)
- ? 0 : TYPE_UNSIGNED (rtype));
+ uns = TYPE_UNSIGNED (rtype);
*mask = double_int_ext (rmask, TYPE_PRECISION (rtype), uns);
*val = double_int_ext (rval, TYPE_PRECISION (rtype), uns);
/* Then extend mask and value according to the target type. */
- uns = (TREE_CODE (type) == INTEGER_TYPE && TYPE_IS_SIZETYPE (type)
- ? 0 : TYPE_UNSIGNED (type));
+ uns = TYPE_UNSIGNED (type);
*mask = double_int_ext (*mask, TYPE_PRECISION (type), uns);
*val = double_int_ext (*val, TYPE_PRECISION (type), uns);
break;
@@ -1130,8 +1128,7 @@ bit_value_binop_1 (enum tree_code code, tree type,
tree r1type, double_int r1val, double_int r1mask,
tree r2type, double_int r2val, double_int r2mask)
{
- bool uns = (TREE_CODE (type) == INTEGER_TYPE
- && TYPE_IS_SIZETYPE (type) ? 0 : TYPE_UNSIGNED (type));
+ bool uns = TYPE_UNSIGNED (type);
/* Assume we'll get a constant result. Use an initial varying value,
we fall back to varying in the end if necessary. */
*mask = double_int_minus_one;
@@ -1198,13 +1195,6 @@ bit_value_binop_1 (enum tree_code code, tree type,
}
else if (shift < 0)
{
- /* ??? We can have sizetype related inconsistencies in
- the IL. */
- if ((TREE_CODE (r1type) == INTEGER_TYPE
- && (TYPE_IS_SIZETYPE (r1type)
- ? 0 : TYPE_UNSIGNED (r1type))) != uns)
- break;
-
shift = -shift;
*mask = double_int_rshift (r1mask, shift,
TYPE_PRECISION (type), !uns);
@@ -1316,12 +1306,7 @@ bit_value_binop_1 (enum tree_code code, tree type,
break;
/* For comparisons the signedness is in the comparison operands. */
- uns = (TREE_CODE (r1type) == INTEGER_TYPE
- && TYPE_IS_SIZETYPE (r1type) ? 0 : TYPE_UNSIGNED (r1type));
- /* ??? We can have sizetype related inconsistencies in the IL. */
- if ((TREE_CODE (r2type) == INTEGER_TYPE
- && TYPE_IS_SIZETYPE (r2type) ? 0 : TYPE_UNSIGNED (r2type)) != uns)
- break;
+ uns = TYPE_UNSIGNED (r1type);
/* If we know the most significant bits we know the values
value ranges by means of treating varying bits as zero