diff options
Diffstat (limited to 'gcc/ipa-icf.c')
-rw-r--r-- | gcc/ipa-icf.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 3f6f432483b..a8d3b800318 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -83,6 +83,7 @@ along with GCC; see the file COPYING3. If not see #include "ipa-icf.h" #include "stor-layout.h" #include "dbgcnt.h" +#include "tree-vector-builder.h" using namespace ipa_icf_gimple; @@ -2024,17 +2025,17 @@ sem_variable::equals (tree t1, tree t2) &TREE_REAL_CST (t2))); case VECTOR_CST: { - unsigned i; - if (VECTOR_CST_NELTS (t1) != VECTOR_CST_NELTS (t2)) return return_false_with_msg ("VECTOR_CST nelts mismatch"); - for (i = 0; i < VECTOR_CST_NELTS (t1); ++i) - if (!sem_variable::equals (VECTOR_CST_ELT (t1, i), - VECTOR_CST_ELT (t2, i))) - return 0; + unsigned int count + = tree_vector_builder::binary_encoded_nelts (t1, t2); + for (unsigned int i = 0; i < count; ++i) + if (!sem_variable::equals (VECTOR_CST_ENCODED_ELT (t1, i), + VECTOR_CST_ENCODED_ELT (t2, i))) + return false; - return 1; + return true; } case ARRAY_REF: case ARRAY_RANGE_REF: |