diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2009-12-02 13:50:52 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2009-12-02 13:50:52 +0000 |
commit | 368a05d55dcb7856065b7a99c4dad6822e864925 (patch) | |
tree | 7e4051e9b7fae9d73287f5c8056ee0a287a5ce90 /gcc | |
parent | ca0b0bf89d0d6b2041df2cb25426e8c7c0be90d5 (diff) | |
download | gcc-368a05d55dcb7856065b7a99c4dad6822e864925.zip gcc-368a05d55dcb7856065b7a99c4dad6822e864925.tar.gz gcc-368a05d55dcb7856065b7a99c4dad6822e864925.tar.bz2 |
re PR middle-end/42224 (32bit pointers to 32bit pointers abort on 64bit VMS and S390X)
gcc/
PR middle-end/42224
* tree.h (int_or_pointer_precision): Remove.
* tree.c (int_or_pointer_precision): Remove.
(integer_pow2p): Use TYPE_PRECISION instead.
(tree_log2): Likewise.
(tree_floor_log2): Likewise.
(signed_or_unsigned_type_for): Likewise.
* fold-const.c (fit_double_type): Likewise.
* varasm.c (initializer_constant_valid_p): Likewise.
gcc/testsuite/
PR middle-end/42224
* gcc.target/s390/pr42224.c: New test.
From-SVN: r154908
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/fold-const.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree.c | 47 | ||||
-rw-r--r-- | gcc/tree.h | 1 | ||||
-rw-r--r-- | gcc/varasm.c | 6 |
6 files changed, 24 insertions, 49 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c14b03e..1f20ff9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2009-12-02 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> + + PR middle-end/42224 + * tree.h (int_or_pointer_precision): Remove. + * tree.c (int_or_pointer_precision): Remove. + (integer_pow2p): Use TYPE_PRECISION instead. + (tree_log2): Likewise. + (tree_floor_log2): Likewise. + (signed_or_unsigned_type_for): Likewise. + * fold-const.c (fit_double_type): Likewise. + * varasm.c (initializer_constant_valid_p): Likewise. + 2009-12-02 Ira Rosen <irar@il.ibm.com> * doc/invoke.texi (-fdump-tree-slp): Document. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 40a580e..1a77dd5 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -206,7 +206,7 @@ fit_double_type (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1, { unsigned HOST_WIDE_INT low0 = l1; HOST_WIDE_INT high0 = h1; - unsigned int prec = int_or_pointer_precision (type); + unsigned int prec = TYPE_PRECISION (type); int sign_extended_type; /* Size types *are* sign extended. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2b856c2..dfe0081 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-12-02 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> + + PR middle-end/42224 + * gcc.target/s390/pr42224.c: New test. + 2009-12-01 Jason Merrill <jason@redhat.com> PR c++/41611 @@ -1685,7 +1685,7 @@ integer_pow2p (const_tree expr) if (TREE_CODE (expr) != INTEGER_CST) return 0; - prec = int_or_pointer_precision (TREE_TYPE (expr)); + prec = TYPE_PRECISION (TREE_TYPE (expr)); high = TREE_INT_CST_HIGH (expr); low = TREE_INT_CST_LOW (expr); @@ -1749,7 +1749,7 @@ tree_log2 (const_tree expr) if (TREE_CODE (expr) == COMPLEX_CST) return tree_log2 (TREE_REALPART (expr)); - prec = int_or_pointer_precision (TREE_TYPE (expr)); + prec = TYPE_PRECISION (TREE_TYPE (expr)); high = TREE_INT_CST_HIGH (expr); low = TREE_INT_CST_LOW (expr); @@ -1785,7 +1785,7 @@ tree_floor_log2 (const_tree expr) if (TREE_CODE (expr) == COMPLEX_CST) return tree_log2 (TREE_REALPART (expr)); - prec = int_or_pointer_precision (TREE_TYPE (expr)); + prec = TYPE_PRECISION (TREE_TYPE (expr)); high = TREE_INT_CST_HIGH (expr); low = TREE_INT_CST_LOW (expr); @@ -9685,12 +9685,8 @@ signed_or_unsigned_type_for (int unsignedp, tree type) based on the named address space it points to. */ if (!TYPE_ADDR_SPACE (TREE_TYPE (t))) t = size_type_node; - else - { - int prec = int_or_pointer_precision (t); - return lang_hooks.types.type_for_size (prec, unsignedp); - } + return lang_hooks.types.type_for_size (TYPE_PRECISION (t), unsignedp); } if (!INTEGRAL_TYPE_P (t) || TYPE_UNSIGNED (t) == unsignedp) @@ -10565,41 +10561,6 @@ build_target_option_node (void) return t; } -/* Return the size in bits of an integer or pointer type. TYPE_PRECISION - contains the bits, but in the past it was not set in some cases and there - was special purpose code that checked for POINTER_TYPE_P or OFFSET_TYPE, so - check that it is consitant when assertion checking is used. */ - -unsigned int -int_or_pointer_precision (const_tree type) -{ -#if ENABLE_ASSERT_CHECKING - unsigned int prec; - - if (POINTER_TYPE_P (type)) - { - addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (type)); - prec = GET_MODE_BITSIZE (targetm.addr_space.pointer_mode (as)); - gcc_assert (prec == TYPE_PRECISION (type)); - } - else if (TREE_CODE (type) == OFFSET_TYPE) - { - prec = POINTER_SIZE; - gcc_assert (prec == TYPE_PRECISION (type)); - } - else - { - prec = TYPE_PRECISION (type); - gcc_assert (prec != 0); - } - - return prec; - -#else - return TYPE_PRECISION (type); -#endif -} - /* Determine the "ultimate origin" of a block. The block may be an inlined instance of an inlined instance of a block which is local to an inline function, so we have to trace all of the way back through the origin chain @@ -4710,7 +4710,6 @@ extern const char *get_name (tree); extern bool stdarg_p (tree); extern bool prototype_p (tree); extern bool auto_var_in_fn_p (const_tree, const_tree); -extern unsigned int int_or_pointer_precision (const_tree); extern tree build_low_bits_mask (tree, unsigned); extern tree tree_strip_nop_conversions (tree); extern tree tree_strip_sign_nop_conversions (tree); diff --git a/gcc/varasm.c b/gcc/varasm.c index af50b5b..fab6219 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -4327,8 +4327,7 @@ initializer_constant_valid_p (tree value, tree endtype) if (TREE_CODE (endtype) == REAL_TYPE) return NULL_TREE; if (! INTEGRAL_TYPE_P (endtype) - || TYPE_PRECISION (endtype) - >= int_or_pointer_precision (TREE_TYPE (value))) + || TYPE_PRECISION (endtype) >= TYPE_PRECISION (TREE_TYPE (value))) { tree valid0 = initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype); @@ -4352,8 +4351,7 @@ initializer_constant_valid_p (tree value, tree endtype) if (TREE_CODE (endtype) == REAL_TYPE) return NULL_TREE; if (! INTEGRAL_TYPE_P (endtype) - || TYPE_PRECISION (endtype) - >= int_or_pointer_precision (TREE_TYPE (value))) + || TYPE_PRECISION (endtype) >= TYPE_PRECISION (TREE_TYPE (value))) { tree valid0 = initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype); |