Add CONSTRUCTOR_NO_CLEARING to operand_equal_p.
authorMartin Liska <mliska@suse.cz>
Thu, 7 Nov 2019 09:44:02 +0000 (10:44 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 7 Nov 2019 09:44:02 +0000 (09:44 +0000)
2019-11-07  Martin Liska  <mliska@suse.cz>

* fold-const.c (operand_compare::operand_equal_p): Add comparison
of CONSTRUCTOR_NO_CLEARING.
(operand_compare::hash_operand): Likewise.

From-SVN: r277912

gcc/ChangeLog
gcc/fold-const.c

index d64d6b7139d35d8739f51b4b0355e985a9bdffa7..94f72ddade6496c880476d036fef055f2dd299d3 100644 (file)
@@ -1,3 +1,9 @@
+2019-11-07  Martin Liska  <mliska@suse.cz>
+
+       * 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  <avr@gjlay.de>
 
        Support 64-bit double and 64-bit long double configurations.
index 88a069f4306794b42d718136cb8c8b3e1efc0c6c..52cb2383db242e298194b7104eba5b51e6c39b77 100644 (file)
@@ -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.  */