Hi, as Richard noticed in my port of the code to operand_equal_p, the checking of CONSTURCTOR in ipa-icf-gimple is incomplete missing the index checks. It is also unnecesary since non-empty ctors does not happen as gimple operands. This patch thus removes the unnecesary code.
Bootstrapped/regtested x86_64-linux, comitted. Honza * ipa-icf-gimple.c (func_checker::compare_operand): Compare only empty constructors. Index: ipa-icf-gimple.c =================================================================== --- ipa-icf-gimple.c (revision 228851) +++ ipa-icf-gimple.c (working copy) @@ -415,20 +415,9 @@ func_checker::compare_operand (tree t1, switch (TREE_CODE (t1)) { case CONSTRUCTOR: - { - unsigned length1 = vec_safe_length (CONSTRUCTOR_ELTS (t1)); - unsigned length2 = vec_safe_length (CONSTRUCTOR_ELTS (t2)); - - if (length1 != length2) - return return_false (); - - for (unsigned i = 0; i < length1; i++) - if (!compare_operand (CONSTRUCTOR_ELT (t1, i)->value, - CONSTRUCTOR_ELT (t2, i)->value)) - return return_false(); - - return true; - } + gcc_assert (!vec_safe_length (CONSTRUCTOR_ELTS (t1)) + && !vec_safe_length (CONSTRUCTOR_ELTS (t2))); + return true; case ARRAY_REF: case ARRAY_RANGE_REF: /* First argument is the array, second is the index. */