aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2006-07-20 13:59:22 +0000
committerPaul Brook <paul@codesourcery.com>2006-07-20 13:59:22 +0000
commit960deba03e41197250941758747e4fae3a97038f (patch)
tree4d599f58fde865c6e7ef85f376318850081c97c0 /gcc/testsuite
parentda2212dc66dd6b12760eca1575912d0b8d508c8f (diff)
Backport from mainline.
PR 27363 gcc/ * cse.c (cse_insn): Add destination addresses to hash table. Check if they are invalidated by this instruction. gcc/testsuite/ * gcc.dg/pr27363.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/csl/sourcerygxx-4_1@115616 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/gcc.dg/pr27363.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr27363.c b/gcc/testsuite/gcc.dg/pr27363.c
new file mode 100644
index 00000000000..40a3c6b3526
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr27363.c
@@ -0,0 +1,39 @@
+/* PR27363. CSE was breaking on the arm store multiple insn used for
+ structure copies. */
+/* { dg-do run } */
+/* { dg-options "-Os" } */
+extern void abort (void);
+
+struct snd_mask {
+ unsigned int bits[6];
+};
+
+static int __attribute__((noinline))
+snd_mask_refine(struct snd_mask *mask)
+{
+ struct snd_mask old;
+
+ old = *mask;
+ if (mask->bits[0]==0 && mask->bits[1]==0)
+ return 1;
+
+ return old.bits[0] != mask->bits[0];
+}
+
+int main(int argc, char *argv[])
+{
+ struct snd_mask mask;
+
+
+ mask.bits[0] = 23;
+ mask.bits[1] = 42;
+ mask.bits[2] = 0;
+ mask.bits[3] = 0;
+ mask.bits[4] = 0;
+ mask.bits[5] = 0;
+
+
+ if (snd_mask_refine(&mask))
+ abort();
+ return 0;
+}