From: Martin Liska Date: Thu, 7 Nov 2019 09:44:02 +0000 (+0100) Subject: Add CONSTRUCTOR_NO_CLEARING to operand_equal_p. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0048539a2a48b6c10bbb0ba0607f57cd16c935aa;p=gcc.git Add CONSTRUCTOR_NO_CLEARING to operand_equal_p. 2019-11-07 Martin Liska * fold-const.c (operand_compare::operand_equal_p): Add comparison of CONSTRUCTOR_NO_CLEARING. (operand_compare::hash_operand): Likewise. From-SVN: r277912 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d64d6b7139d..94f72ddade6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-11-07 Martin Liska + + * fold-const.c (operand_compare::operand_equal_p): Add comparison + of CONSTRUCTOR_NO_CLEARING. + (operand_compare::hash_operand): Likewise. + 2019-11-07 Georg-Johann Lay Support 64-bit double and 64-bit long double configurations. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 88a069f4306..52cb2383db2 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3475,6 +3475,9 @@ operand_compare::operand_equal_p (const_tree arg0, const_tree arg1, case tcc_exceptional: if (TREE_CODE (arg0) == CONSTRUCTOR) { + if (CONSTRUCTOR_NO_CLEARING (arg0) != CONSTRUCTOR_NO_CLEARING (arg1)) + return false; + /* In GIMPLE constructors are used only to build vectors from elements. Individual elements in the constructor must be indexed in increasing order and form an initial sequence. @@ -3657,6 +3660,7 @@ operand_compare::hash_operand (const_tree t, inchash::hash &hstate, unsigned HOST_WIDE_INT idx; tree field, value; flags &= ~OEP_ADDRESS_OF; + hstate.add_int (CONSTRUCTOR_NO_CLEARING (t)); FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (t), idx, field, value) { /* In GIMPLE the indexes can be either NULL or matching i. */