diff options
author | Richard Stallman <rms@gnu.org> | 1993-05-12 04:29:00 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-05-12 04:29:00 +0000 |
commit | 2026444ac9804a075ac6c5e16c1f8d43e9005139 (patch) | |
tree | 6077b434d0e00fded01863451de571516d510a89 | |
parent | dba6874f46dba090fba16254dc0163e204904899 (diff) | |
download | gcc-2026444ac9804a075ac6c5e16c1f8d43e9005139.zip gcc-2026444ac9804a075ac6c5e16c1f8d43e9005139.tar.gz gcc-2026444ac9804a075ac6c5e16c1f8d43e9005139.tar.bz2 |
(real_value_from_int_cst): Use temporary variable `e' to
work around bugs in 386 PCC.
(build_array_type): Delete the code to set TYPE_MAIN_VARIANT.
(build_array_type):
Don't change TYPE_MAIN_VARIANT if incomplete (domain not known).
From-SVN: r4428
-rw-r--r-- | gcc/tree.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index e734a26..8cf85aa029 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -1154,6 +1154,10 @@ real_value_from_int_cst (i) tree i; { REAL_VALUE_TYPE d; + REAL_VALUE_TYPE e; + /* Some 386 compilers mishandle unsigned int to float conversions, + so introduce a temporary variable E to avoid those bugs. */ + #ifdef REAL_ARITHMETIC if (! TREE_UNSIGNED (TREE_TYPE (i))) REAL_VALUE_FROM_INT (d, TREE_INT_CST_LOW (i), TREE_INT_CST_HIGH (i)); @@ -1163,17 +1167,21 @@ real_value_from_int_cst (i) if (TREE_INT_CST_HIGH (i) < 0 && ! TREE_UNSIGNED (TREE_TYPE (i))) { d = (double) (~ TREE_INT_CST_HIGH (i)); - d *= ((double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)) + e = ((double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)) * (double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2))); - d += (double) (unsigned HOST_WIDE_INT) (~ TREE_INT_CST_LOW (i)); + d *= e; + e = (double) (unsigned HOST_WIDE_INT) (~ TREE_INT_CST_LOW (i)); + d += e; d = (- d - 1.0); } else { d = (double) (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (i); - d *= ((double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)) + e = ((double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)) * (double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2))); - d += (double) (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (i); + d *= e; + e = (double) (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (i); + d += e; } #endif /* not REAL_ARITHMETIC */ return d; @@ -2825,23 +2833,21 @@ build_array_type (elt_type, index_type) if (index_type == 0) { - /* The main variant of an array type should always - be an array whose element type is the main variant. */ - if (elt_type != TYPE_MAIN_VARIANT (elt_type)) - change_main_variant (t, build_array_type (TYPE_MAIN_VARIANT (elt_type), - index_type)); - return t; } hashcode = TYPE_HASH (elt_type) + TYPE_HASH (index_type); t = type_hash_canon (hashcode, t); +#if 0 /* This led to crashes, because it could put a temporary node + on the TYPE_NEXT_VARIANT chain of a permanent one. */ + */ /* The main variant of an array type should always be an array whose element type is the main variant. */ if (elt_type != TYPE_MAIN_VARIANT (elt_type)) change_main_variant (t, build_array_type (TYPE_MAIN_VARIANT (elt_type), index_type)); +#endif if (TYPE_SIZE (t) == 0) layout_type (t); |