diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-12 09:21:47 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-12 09:21:47 +0000 |
commit | 96995faf40e6daaab7eb2c1477a6964b53f13d17 (patch) | |
tree | 2d38520350aaf573f99faa7497e2f8c3d604d343 /gcc/testsuite | |
parent | 30b342c628a3f2035b4007020bf13f4208a1a06b (diff) | |
download | gcc-96995faf40e6daaab7eb2c1477a6964b53f13d17.tar.gz |
PR optimization/9888
* config/i386/i386.md (jcc_1): Fix range.
(jcc_2): Likewise.
(jump): LIkewise.
(doloop_end_internal): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64230 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/i386-loop-2.c | 80 |
2 files changed, 84 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 76de10e7e5f..3e0633c3ef1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-03-12 Eric Botcazou <ebotcazou@libertysurf.fr> + + * gcc.dg/i386-loop-2.c: New test. + 2003-03-11 Mark Mitchell <mark@codesourcery.com> PR c++/9474 diff --git a/gcc/testsuite/gcc.dg/i386-loop-2.c b/gcc/testsuite/gcc.dg/i386-loop-2.c new file mode 100644 index 00000000000..3a3e69e98b4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/i386-loop-2.c @@ -0,0 +1,80 @@ +/* PR optimization/9888 */ +/* Originator: Jim Bray <jb@as220.org> */ +/* { dg-do run { target i?86-*-* } } */ +/* { dg-options "-mtune=k6 -Os" } */ + +enum reload_type +{ + RELOAD_FOR_INPUT, RELOAD_FOR_OUTPUT, RELOAD_FOR_INSN, + RELOAD_FOR_INPUT_ADDRESS, RELOAD_FOR_INPADDR_ADDRESS, + RELOAD_FOR_OUTPUT_ADDRESS, RELOAD_FOR_OUTADDR_ADDRESS, + RELOAD_FOR_OPERAND_ADDRESS, RELOAD_FOR_OPADDR_ADDR, + RELOAD_OTHER, RELOAD_FOR_OTHER_ADDRESS +}; + +#define FOO_SIZE 3 + +/* My results, varying with FOO_SIZE: + 30: asm error "value of ..fff77 too large: + 3 to 29: ....ff7d... + 1 to 2: no error. */ + +struct reload +{ + int foo[FOO_SIZE]; + int opnum; + enum reload_type when_needed; + unsigned int optional:1; + unsigned int secondary_p:1; +}; + +#define N_RELOADS 2 + +struct reload rld[N_RELOADS]; +int n_reloads = N_RELOADS; + +int main(void) +{ + int i; + + enum reload_type operand_type[1]; + + enum reload_type address_type[1]; + + int operand_reloadnum[1]; + int goal_alternative_matches[1]; + + for (i = 0; i < n_reloads; i++) + { + if (rld[i].secondary_p + && rld[i].when_needed == operand_type[rld[i].opnum]) + rld[i].when_needed = address_type[rld[i].opnum]; + + if ((rld[i].when_needed == RELOAD_FOR_INPUT_ADDRESS + || rld[i].when_needed == RELOAD_FOR_OUTPUT_ADDRESS + || rld[i].when_needed == RELOAD_FOR_INPADDR_ADDRESS + || rld[i].when_needed == RELOAD_FOR_OUTADDR_ADDRESS) + && (operand_reloadnum[rld[i].opnum] < 0 + || rld[operand_reloadnum[rld[i].opnum]].optional)) + { + + if (rld[i].when_needed == RELOAD_FOR_INPADDR_ADDRESS + || rld[i].when_needed == RELOAD_FOR_OUTADDR_ADDRESS) + rld[i].when_needed = RELOAD_FOR_OPADDR_ADDR; + else + rld[i].when_needed = RELOAD_FOR_OPERAND_ADDRESS; + } + + if ((rld[i].when_needed == RELOAD_FOR_INPUT_ADDRESS + || rld[i].when_needed == RELOAD_FOR_INPADDR_ADDRESS) + && operand_reloadnum[rld[i].opnum] >= 0 + && (rld[operand_reloadnum[rld[i].opnum]].when_needed + == RELOAD_OTHER)) + rld[i].when_needed = RELOAD_FOR_OTHER_ADDRESS; + + if (goal_alternative_matches[rld[i].opnum] >= 0) + rld[i].opnum = goal_alternative_matches[rld[i].opnum]; + } + + return 0; +} |