diff options
Diffstat (limited to 'gcc/varasm.cc')
-rw-r--r-- | gcc/varasm.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/varasm.cc b/gcc/varasm.cc index dd84754..542315f 100644 --- a/gcc/varasm.cc +++ b/gcc/varasm.cc @@ -4885,7 +4885,8 @@ initializer_constant_valid_p_1 (tree value, tree endtype, tree *cache) /* Allow length-preserving conversions between integer types and floating-point types. */ if (((INTEGRAL_TYPE_P (dest_type) && INTEGRAL_TYPE_P (src_type)) - || (FLOAT_TYPE_P (dest_type) && FLOAT_TYPE_P (src_type))) + || (SCALAR_FLOAT_TYPE_P (dest_type) + && SCALAR_FLOAT_TYPE_P (src_type))) && (TYPE_PRECISION (dest_type) == TYPE_PRECISION (src_type))) return initializer_constant_valid_p_1 (src, endtype, cache); @@ -4943,6 +4944,7 @@ initializer_constant_valid_p_1 (tree value, tree endtype, tree *cache) if (cache && cache[0] == value) return cache[1]; if (! INTEGRAL_TYPE_P (endtype) + || ! INTEGRAL_TYPE_P (TREE_TYPE (value)) || TYPE_PRECISION (endtype) >= TYPE_PRECISION (TREE_TYPE (value))) { tree ncache[4] = { NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE }; @@ -4979,6 +4981,7 @@ initializer_constant_valid_p_1 (tree value, tree endtype, tree *cache) if (cache && cache[0] == value) return cache[1]; if (! INTEGRAL_TYPE_P (endtype) + || ! INTEGRAL_TYPE_P (TREE_TYPE (value)) || TYPE_PRECISION (endtype) >= TYPE_PRECISION (TREE_TYPE (value))) { tree ncache[4] = { NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE }; |