diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-02-12 19:31:53 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2008-02-12 19:31:53 +0100 |
commit | d7b8033f3e4f59d5ff54ab68fe5667467a52a273 (patch) | |
tree | cc86a9d5f9cae1c352e371479313945266e39ca9 /gcc/testsuite/gcc.target | |
parent | 2e250fa218c90851d585ee46240201fcdec857f9 (diff) | |
download | gcc-d7b8033f3e4f59d5ff54ab68fe5667467a52a273.zip gcc-d7b8033f3e4f59d5ff54ab68fe5667467a52a273.tar.gz gcc-d7b8033f3e4f59d5ff54ab68fe5667467a52a273.tar.bz2 |
re PR inline-asm/35160 (local-alloc introduces sharing of the same pseudo/hard reg between different output regs in inline asm)
PR inline-asm/35160
* function.c (match_asm_constraints_1): Don't replace the same input
multiple times.
* gcc.target/i386/pr35160.c: New test.
From-SVN: r132263
Diffstat (limited to 'gcc/testsuite/gcc.target')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr35160.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr35160.c b/gcc/testsuite/gcc.target/i386/pr35160.c new file mode 100644 index 0000000..587b846 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr35160.c @@ -0,0 +1,31 @@ +/* PR inline-asm/35160 */ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +extern void abort (void); + +void +__attribute__((noinline)) +foo (unsigned int *y) +{ + unsigned int c0, c1, c2, d0, d1, d2; + d0 = 0; d1 = 0; d2 = 0; c0 = c1 = c2 = 0; + + __asm__ ("movl $7, %k0; movl $8, %k1; movl $9, %k2" + : "+r" (d0), "+r" (d1), "+r" (d2)); + __asm__ ("movl %3, %0; movl %4, %1; movl %5, %2" + : "+r" (c0), "+r" (c1), "+r" (c2), "+r" (d0), "+r" (d1), "+r" (d2)); + y[0] = c0; + y[1] = c1; + y[2] = c2; +} + +int +main (void) +{ + unsigned int y[3]; + foo (y); + if (y[0] != 7 || y[1] != 8 || y[2] != 9) + abort (); + return 0; +} |