diff options
| author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-25 09:51:25 +0000 |
|---|---|---|
| committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-25 09:51:25 +0000 |
| commit | 63d6ccd8eca2db114ba5261a3b324a7f98328d4e (patch) | |
| tree | 6f9e4c8df11208ff2e55591d7a5a9eadd91320cb | |
| parent | b04d77fe940d96454c3dd823918022b8ccd43e0e (diff) | |
| download | ppe42-gcc-63d6ccd8eca2db114ba5261a3b324a7f98328d4e.tar.gz ppe42-gcc-63d6ccd8eca2db114ba5261a3b324a7f98328d4e.zip | |
* config/i386/i386.c (ix86_expand_int_movcc): If overlap between
out and comparison sequence has been detected, put result into
proper temporary pseudo.
* gcc.c-torture/execute/20010422-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41536 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/config/i386/i386.c | 10 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20010422-1.c | 15 |
4 files changed, 30 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d310632b7a..e22d747c2ce 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-04-25 Jakub Jelinek <jakub@redhat.com> + + * config/i386/i386.c (ix86_expand_int_movcc): If overlap between + out and comparison sequence has been detected, put result into + proper temporary pseudo. + 2001-04-24 Zack Weinberg <zackw@stanford.edu> * Makefile.in (LIB2FUNCS): Remove _varargs and __dummy. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 163b36e5f4d..5e5b5a56d78 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6279,7 +6279,7 @@ ix86_expand_int_movcc (operands) * Size 5 - 8. */ if (ct) - emit_insn (gen_addsi3 (out, out, GEN_INT (ct))); + emit_insn (gen_addsi3 (tmp, tmp, GEN_INT (ct))); } else if (cf == -1) { @@ -6290,7 +6290,7 @@ ix86_expand_int_movcc (operands) * * Size 8. */ - emit_insn (gen_iorsi3 (out, out, GEN_INT (ct))); + emit_insn (gen_iorsi3 (tmp, tmp, GEN_INT (ct))); } else if (diff == -1 && ct) { @@ -6304,7 +6304,7 @@ ix86_expand_int_movcc (operands) */ emit_insn (gen_one_cmplsi2 (tmp, tmp)); if (cf) - emit_insn (gen_addsi3 (out, out, GEN_INT (cf))); + emit_insn (gen_addsi3 (tmp, tmp, GEN_INT (cf))); } else { @@ -6316,10 +6316,10 @@ ix86_expand_int_movcc (operands) * * Size 8 - 11. */ - emit_insn (gen_andsi3 (out, out, GEN_INT (trunc_int_for_mode + emit_insn (gen_andsi3 (tmp, tmp, GEN_INT (trunc_int_for_mode (cf - ct, SImode)))); if (ct) - emit_insn (gen_addsi3 (out, out, GEN_INT (ct))); + emit_insn (gen_addsi3 (tmp, tmp, GEN_INT (ct))); } if (tmp != out) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a0f0f2504d4..d53a32e1c9d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-04-25 Jakub Jelinek <jakub@redhat.com> + + * gcc.c-torture/execute/20010422-1.c: New test. + 2001-04-25 Nathan Sidwell <nathan@codesourcery.com> * g++.old-deja/g++.ns/type2.C: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/20010422-1.c b/gcc/testsuite/gcc.c-torture/execute/20010422-1.c new file mode 100644 index 00000000000..5c6bccc9ed1 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20010422-1.c @@ -0,0 +1,15 @@ +unsigned int foo(unsigned int x) +{ + if (x < 5) + x = 4; + else + x = 8; + return x; +} + +int main(void) +{ + if (foo (8) != 8) + abort (); + exit (0); +} |

