2020-04-01 Jakub Jelinek <jakub@redhat.com>
PR middle-end/94436
* gcc.dg/pr94436.c: New test.
2020-04-01 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/94436
+ * gcc.dg/pr94436.c: New test.
+
PR middle-end/94423
* gcc.dg/ubsan/pr94423.c: New test.
--- /dev/null
+/* PR middle-end/94436 */
+/* { dg-do compile } */
+/* { dg-options "-Wincompatible-pointer-types" } */
+
+struct S { int s; };
+int foo (struct S *);
+
+int
+bar (void)
+{
+ int s = 0;
+ return foo ((struct S *) ((char *) &s - (char *) &((struct S *) 0)->s)); /* { dg-bogus "from incompatible pointer type" } */
+}