re PR middle-end/63184 (Fails to simplify comparison)
authorRichard Biener <rguenther@suse.de>
Wed, 5 Dec 2018 14:55:59 +0000 (14:55 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 5 Dec 2018 14:55:59 +0000 (14:55 +0000)
2018-12-05  Richard Biener  <rguenther@suse.de>

PR middle-end/63184
* c-c++-common/pr19807-2.c: New testcase.
* c-c++-common/pr19807-3.c: Likewise.

From-SVN: r266827

gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr19807-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/pr19807-3.c [new file with mode: 0644]

index b95e7942d86edb2cf2bb3738e4ec253e5c4fbb22..b8fb2c033d59cc5866993a934814fbafab34ccee 100644 (file)
@@ -1,3 +1,9 @@
+2018-12-05  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/63184
+       * c-c++-common/pr19807-2.c: New testcase.
+       * c-c++-common/pr19807-3.c: Likewise.
+
 2018-12-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        PR testsuite/88208
diff --git a/gcc/testsuite/c-c++-common/pr19807-2.c b/gcc/testsuite/c-c++-common/pr19807-2.c
new file mode 100644 (file)
index 0000000..c8b2a57
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do link } */
+/* { dg-options "-O" } */
+
+extern void link_error(void);
+int i;
+int main()
+{
+  int a[4];
+  if ((char*)&a[1] + 4*i + 4 != (char*)&a[i+2])
+    link_error();
+  return 0;
+}
diff --git a/gcc/testsuite/c-c++-common/pr19807-3.c b/gcc/testsuite/c-c++-common/pr19807-3.c
new file mode 100644 (file)
index 0000000..d882bd3
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do link } */
+/* { dg-options "-O" } */
+
+extern void link_error(void);
+int i;
+int main()
+{
+  int a[4];
+  if (&a[1] + i + 1 != &a[i+2])
+    link_error();
+  return 0;
+}