aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2003-07-03 09:30:03 +0200
committerEric Botcazou <ebotcazou@gcc.gnu.org>2003-07-03 07:30:03 +0000
commit8821d0914c6c0679a76995f95e7b7cc38d258da3 (patch)
tree7e595affeb40107a2fa540e31a6dd8bea9a5cbed /gcc/testsuite
parent7960bf2230487ce4626051a2710ecdab9a57d183 (diff)
downloadgcc-8821d0914c6c0679a76995f95e7b7cc38d258da3.zip
gcc-8821d0914c6c0679a76995f95e7b7cc38d258da3.tar.gz
gcc-8821d0914c6c0679a76995f95e7b7cc38d258da3.tar.bz2
re PR rtl-optimization/11381 (volatile memory access optimized away)
PR optimization/11381 * simplify-rtx.c (simplify_relational_operation): Check that two equal operands have no side-effects before simplifying the comparison. From-SVN: r68869
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/i386-volatile-1.c14
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 78f0f59..e598f21 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2003-07-03 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/i386-volatile-1.c: New test.
+
2003-07-02 Nathan Sidwell <nathan@codesourcery.com>
PR c++/11072
diff --git a/gcc/testsuite/gcc.dg/i386-volatile-1.c b/gcc/testsuite/gcc.dg/i386-volatile-1.c
new file mode 100644
index 0000000..633ea50
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/i386-volatile-1.c
@@ -0,0 +1,14 @@
+/* PR optimization/11381 */
+/* Originator: <tobias@ringstrom.mine.nu> */
+/* { dg-do compile { target i?86-*-* } } */
+/* { dg-options "-O" } */
+
+/* Verify that the comparison is not optimized away. */
+
+void foo(volatile unsigned int *vaddr)
+{
+ while (*vaddr != *vaddr)
+ ;
+}
+
+/* { dg-final { scan-assembler "cmp" } } */