aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-06-26 09:57:21 -0700
committerIan Lance Taylor <iant@golang.org>2023-06-26 09:57:21 -0700
commitaa1e672b5d99102b03eb5fb9c51609c45f62bff7 (patch)
tree886212591b1c9d127eaaf234a4a2e22452ea384a /gcc/varasm.cc
parent97e31a0a2a2d2273687fcdb4e5416aab1a2186e1 (diff)
parent3a39a31b8ae9c6465434aefa657f7fcc86f905c0 (diff)
downloadgcc-devel/gccgo.zip
gcc-devel/gccgo.tar.gz
gcc-devel/gccgo.tar.bz2
Merge from trunk revision 3a39a31b8ae9c6465434aefa657f7fcc86f905c0.devel/gccgo
Diffstat (limited to 'gcc/varasm.cc')
-rw-r--r--gcc/varasm.cc5
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 };