diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-03-20 00:24:43 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2007-03-20 00:24:43 +0100 |
commit | 5d8a54345abbbb4dcf013a03bf6e6742414c389d (patch) | |
tree | 06566dbc082fed23428c52e95c555fa28d3ed791 /gcc | |
parent | 3eabae3bbb185d38a239196d286bfd9cfcb88f4e (diff) | |
download | gcc-5d8a54345abbbb4dcf013a03bf6e6742414c389d.zip gcc-5d8a54345abbbb4dcf013a03bf6e6742414c389d.tar.gz gcc-5d8a54345abbbb4dcf013a03bf6e6742414c389d.tar.bz2 |
re PR inline-asm/30505 (asm operand has impossible constraints.)
PR inline-asm/30505
* reload1.c (reload): Do invalid ASM checking after
cleanup_subreg_operands.
* gcc.target/i386/pr30505.c: New test.
From-SVN: r123072
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/reload1.c | 30 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr30505.c | 19 |
4 files changed, 45 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ec45c0e..dc56f6d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-03-20 Jakub Jelinek <jakub@redhat.com> + + PR inline-asm/30505 + * reload1.c (reload): Do invalid ASM checking after + cleanup_subreg_operands. + 2007-03-19 Jeff Law <law@redhat.com> * tree-cfg.c (find_taken_edge): Tighten conditions for diff --git a/gcc/reload1.c b/gcc/reload1.c index 2aad6b0..9a56fc4 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -1173,20 +1173,6 @@ reload (rtx first, int global) { rtx *pnote; - /* Clean up invalid ASMs so that they don't confuse later passes. - See PR 21299. */ - if (asm_noperands (PATTERN (insn)) >= 0) - { - extract_insn (insn); - if (!constrain_operands (1)) - { - error_for_asm (insn, - "%<asm%> operand has impossible constraints"); - delete_insn (insn); - continue; - } - } - if (CALL_P (insn)) replace_pseudos_in (& CALL_INSN_FUNCTION_USAGE (insn), VOIDmode, CALL_INSN_FUNCTION_USAGE (insn)); @@ -1245,8 +1231,22 @@ reload (rtx first, int global) add_auto_inc_notes (insn, PATTERN (insn)); #endif - /* And simplify (subreg (reg)) if it appears as an operand. */ + /* Simplify (subreg (reg)) if it appears as an operand. */ cleanup_subreg_operands (insn); + + /* Clean up invalid ASMs so that they don't confuse later passes. + See PR 21299. */ + if (asm_noperands (PATTERN (insn)) >= 0) + { + extract_insn (insn); + if (!constrain_operands (1)) + { + error_for_asm (insn, + "%<asm%> operand has impossible constraints"); + delete_insn (insn); + continue; + } + } } /* If we are doing stack checking, give a warning if this function's diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2ac8178..9a6607f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-03-20 Jakub Jelinek <jakub@redhat.com> + + PR inline-asm/30505 + * gcc.target/i386/pr30505.c: New test. + 2007-03-19 Mark Shinwell <shinwell@codesourcery.com> * gcc.target/arm/register-variables.c: New. diff --git a/gcc/testsuite/gcc.target/i386/pr30505.c b/gcc/testsuite/gcc.target/i386/pr30505.c new file mode 100644 index 0000000..a3b2368 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr30505.c @@ -0,0 +1,19 @@ +/* PR inline-asm/30505 */ +/* { dg-do compile { target ilp32 } } */ +/* { dg-options "-O2" } */ + +unsigned long long a, c; +unsigned int b, d; + +void +test () +{ + unsigned int e, f; + + __asm__ ("divl %5;movl %1, %0;movl %4, %1;divl %5" + : "=&rm" (e), "=a" (f), "=d" (d) + : "1" ((unsigned int) (a >> 32)), "g" ((unsigned int) a), + "rm" (b), "2" (0) + : "cc"); + c = (unsigned long long) e << 32 | f; +} |