revert: re PR rtl-optimization/57381 (array of volatile pointers hangs gcc)
[gcc.git] / gcc / fold-const.c
index 38db3f1d83231fc73f583f6dbd30a568139ddc38..a2b7ac183126ec6d28afcef4ecea6ca5068809a0 100644 (file)
@@ -2664,10 +2664,10 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
        case COMPONENT_REF:
          /* Handle operand 2 the same as for ARRAY_REF.  Operand 0
             may be NULL when we're called to compare MEM_EXPRs.  */
-         if (!OP_SAME_WITH_NULL (0) || !OP_SAME (1))
+         if (!OP_SAME_WITH_NULL (0))
            return 0;
          flags &= ~OEP_CONSTANT_ADDRESS_OF;
-         return OP_SAME_WITH_NULL (2);
+         return OP_SAME (1) && OP_SAME_WITH_NULL (2);
 
        case BIT_FIELD_REF:
          if (!OP_SAME (0))