aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-06-15 22:53:54 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2018-06-15 22:53:54 +0200
commit487f2f61bb1bad721f41a7f767efe04df4b0b058 (patch)
tree931ee4adff13dafe3bfa8dd9c958ae91481cc4c2 /gcc/testsuite
parentda8ea71e3733ba9c5f70a84cea9cafea6b0126b0 (diff)
downloadgcc-487f2f61bb1bad721f41a7f767efe04df4b0b058.zip
gcc-487f2f61bb1bad721f41a7f767efe04df4b0b058.tar.gz
gcc-487f2f61bb1bad721f41a7f767efe04df4b0b058.tar.bz2
re PR c/86093 (volatile ignored on pointer in C)
PR c/86093 * c-typeck.c (pointer_diff): Cast both pointers to unqualified types before doing POINTER_DIFF_EXPR. * c-c++-common/pr86093.c: New test. From-SVN: r261663
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/c-c++-common/pr86093.c12
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 89b0567..03fc2a0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2018-06-15 Jakub Jelinek <jakub@redhat.com>
+ PR c/86093
+ * c-c++-common/pr86093.c: New test.
+
PR middle-end/85878
* gfortran.fortran-torture/compile/pr85878.f90: New test.
diff --git a/gcc/testsuite/c-c++-common/pr86093.c b/gcc/testsuite/c-c++-common/pr86093.c
new file mode 100644
index 0000000..06afbd6
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr86093.c
@@ -0,0 +1,12 @@
+/* PR c/86093 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-not "return 0;" "optimized" } } */
+
+char *volatile p;
+
+__PTRDIFF_TYPE__
+foo (void)
+{
+ return p - p;
+}