aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r--gcc/tree-ssa-ccp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index ae6006d..3acddf9 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -147,6 +147,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-core.h"
#include "stringpool.h"
#include "attribs.h"
+#include "tree-vector-builder.h"
/* Possible lattice values. */
typedef enum
@@ -465,11 +466,14 @@ valid_lattice_transition (ccp_prop_value_t old_val, ccp_prop_value_t new_val)
else if (VECTOR_FLOAT_TYPE_P (type)
&& !HONOR_NANS (type))
{
- for (unsigned i = 0; i < VECTOR_CST_NELTS (old_val.value); ++i)
+ unsigned int count
+ = tree_vector_builder::binary_encoded_nelts (old_val.value,
+ new_val.value);
+ for (unsigned int i = 0; i < count; ++i)
if (!REAL_VALUE_ISNAN
- (TREE_REAL_CST (VECTOR_CST_ELT (old_val.value, i)))
- && !operand_equal_p (VECTOR_CST_ELT (old_val.value, i),
- VECTOR_CST_ELT (new_val.value, i), 0))
+ (TREE_REAL_CST (VECTOR_CST_ENCODED_ELT (old_val.value, i)))
+ && !operand_equal_p (VECTOR_CST_ENCODED_ELT (old_val.value, i),
+ VECTOR_CST_ENCODED_ELT (new_val.value, i), 0))
return false;
return true;
}