diff options
| author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-20 09:59:28 +0000 |
|---|---|---|
| committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-20 09:59:28 +0000 |
| commit | cb77e60d0bf54f3cfa78ed62af62a22db8eb1c61 (patch) | |
| tree | 7be5e549048a9e9ba6831c5dc806ac37a8c5567a | |
| parent | 19047a6ac7ef32eaa0c2ede0b914d0e30e4cd840 (diff) | |
| download | ppe42-gcc-cb77e60d0bf54f3cfa78ed62af62a22db8eb1c61.tar.gz ppe42-gcc-cb77e60d0bf54f3cfa78ed62af62a22db8eb1c61.zip | |
* config/sh/sh.md (udivsi3): Don't put udivsi3_i4_media instructions
into a libcall block.
(divsi3): Likewise divsi3_i4_media.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59299 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/config/sh/sh.md | 26 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20021120-2.c | 21 |
4 files changed, 41 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e3ddb43bf83..414a9475858 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2002-11-20 Richard Sandiford <rsandifo@redhat.com> + * config/sh/sh.md (udivsi3): Don't put udivsi3_i4_media instructions + into a libcall block. + (divsi3): Likewise divsi3_i4_media. + +2002-11-20 Richard Sandiford <rsandifo@redhat.com> + * global.c (find_reg): Check HARD_REGNO_NREGS before kicking out another register. diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index ed14fbd4e33..956c2253b9b 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -1341,7 +1341,7 @@ "" " { - rtx first = 0, last; + rtx first, last; operands[3] = gen_reg_rtx (Pmode); /* Emit the move of the address to a pseudo outside of the libcall. */ @@ -1358,8 +1358,8 @@ { operands[1] = force_reg (SImode, operands[1]); operands[2] = force_reg (SImode, operands[2]); - last = gen_udivsi3_i4_media (operands[0], operands[1], operands[2]); - first = last; + emit_insn (gen_udivsi3_i4_media (operands[0], operands[1], operands[2])); + DONE; } else if (TARGET_SH5) { @@ -1386,11 +1386,8 @@ gen_rtx_SYMBOL_REF (SImode, \"__udivsi3\")); last = gen_udivsi3_i1 (operands[0], operands[3]); } - if (! first) - { - first = emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]); - emit_move_insn (gen_rtx_REG (SImode, 5), operands[2]); - } + first = emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]); + emit_move_insn (gen_rtx_REG (SImode, 5), operands[2]); last = emit_insn (last); /* Wrap the sequence in REG_LIBCALL / REG_RETVAL notes so that loop invariant code motion can move it. */ @@ -1494,7 +1491,7 @@ "" " { - rtx first = 0, last; + rtx first, last; operands[3] = gen_reg_rtx (Pmode); /* Emit the move of the address to a pseudo outside of the libcall. */ @@ -1511,8 +1508,8 @@ { operands[1] = force_reg (SImode, operands[1]); operands[2] = force_reg (SImode, operands[2]); - last = gen_divsi3_i4_media (operands[0], operands[1], operands[2]); - first = last; + emit_insn (gen_divsi3_i4_media (operands[0], operands[1], operands[2])); + DONE; } else if (TARGET_SH5) { @@ -1538,11 +1535,8 @@ emit_move_insn (operands[3], gen_rtx_SYMBOL_REF (SImode, \"__sdivsi3\")); last = gen_divsi3_i1 (operands[0], operands[3]); } - if (! first) - { - first = emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]); - emit_move_insn (gen_rtx_REG (SImode, 5), operands[2]); - } + first = emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]); + emit_move_insn (gen_rtx_REG (SImode, 5), operands[2]); last = emit_insn (last); /* Wrap the sequence in REG_LIBCALL / REG_RETVAL notes so that loop invariant code motion can move it. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1ba905f524a..01d9f4148ad 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2002-11-20 Richard Sandiford <rsandifo@redhat.com> + * gcc.c-torture/execute/20021120-2.c: New test. + +2002-11-20 Richard Sandiford <rsandifo@redhat.com> + * gcc.c-torture/execute/20021120-1.c: New test. 2002-11-20 Jakub Jelinek <jakub@redhat.com> diff --git a/gcc/testsuite/gcc.c-torture/execute/20021120-2.c b/gcc/testsuite/gcc.c-torture/execute/20021120-2.c new file mode 100644 index 00000000000..d8876c0ebfa --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20021120-2.c @@ -0,0 +1,21 @@ +int g1, g2; + +void foo (int x) +{ + int y; + + if (x) + y = 793; + else + y = 793; + g1 = 7930 / y; + g2 = 7930 / x; +} + +int main () +{ + foo (793); + if (g1 != 10 || g2 != 10) + abort (); + exit (0); +} |

