PR middle-end/83164
* tree-cfg.c (verify_gimple_assign_binary): Don't require
types_compatible_p, just that TYPE_MODE is the same.
* gcc.c-torture/compile/pr83164.c: New test.
From-SVN: r255470
+2017-12-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/83164
+ * tree-cfg.c (verify_gimple_assign_binary): Don't require
+ types_compatible_p, just that TYPE_MODE is the same.
+
2017-12-07 Martin Sebor <msebor@redhat.com>
PR c/81544
+2017-12-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/83164
+ * gcc.c-torture/compile/pr83164.c: New test.
+
2017-12-07 Martin Sebor <msebor@redhat.com>
PR c/81544
--- /dev/null
+/* PR middle-end/83164 */
+
+__PTRDIFF_TYPE__
+foo (void)
+{
+ return (char *) foo - (char *) 0x1230;
+}
{
if (!POINTER_TYPE_P (rhs1_type)
|| !POINTER_TYPE_P (rhs2_type)
- || !types_compatible_p (rhs1_type, rhs2_type)
+ /* Because we special-case pointers to void we allow difference
+ of arbitrary pointers with the same mode. */
+ || TYPE_MODE (rhs1_type) != TYPE_MODE (rhs2_type)
|| TREE_CODE (lhs_type) != INTEGER_TYPE
|| TYPE_UNSIGNED (lhs_type)
|| TYPE_PRECISION (lhs_type) != TYPE_PRECISION (rhs1_type))