diff options
author | Jakub Jelinek <jakub@redhat.com> | 2002-01-16 18:44:24 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2002-01-16 18:44:24 +0100 |
commit | b8c1a6b8175da581b6d613e579f94948e2ca6394 (patch) | |
tree | 02bf8add1add28e9b859fa3fb80b7653e6a7a832 /gcc | |
parent | 1e4e4df27a0ca6e1fe7519e6f093ff84cabb5197 (diff) | |
download | gcc-b8c1a6b8175da581b6d613e579f94948e2ca6394.zip gcc-b8c1a6b8175da581b6d613e579f94948e2ca6394.tar.gz gcc-b8c1a6b8175da581b6d613e579f94948e2ca6394.tar.bz2 |
re PR target/5309 (Infinite loop in cc1 on sparcv9-sun-solaris2.8 with -m64, short example)
PR target/5309:
* config/sparc/sparc.c (ultrasparc_adjust_cost): Handle TYPE_IDIV the
same way as TYPE_IMUL.
(ultrasparc_sched_reorder): Likewise.
* config/sparc/sparc.md (type): Add comment to update
ultrasparc_sched_reorder when making changes.
* gcc.dg/ultrasp4.c: New test.
From-SVN: r48917
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 4 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.md | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/ultrasp4.c | 13 |
5 files changed, 29 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 28d4243..17bc386 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2002-01-16 Jakub Jelinek <jakub@redhat.com> + + PR target/5309: + * config/sparc/sparc.c (ultrasparc_adjust_cost): Handle TYPE_IDIV the + same way as TYPE_IMUL. + (ultrasparc_sched_reorder): Likewise. + * config/sparc/sparc.md (type): Add comment to update + ultrasparc_sched_reorder when making changes. + 2002-01-16 Kazu Hirata <kazu@hxi.com> * doc/invoke.texi: Change the dump file name of block diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 3e3d1a8..53f8c41 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -7202,7 +7202,7 @@ ultrasparc_adjust_cost (insn, link, dep_insn, cost) /* Nothing issues in parallel with integer multiplies, so mark as zero cost since the scheduler can not do anything about it. */ - if (insn_type == TYPE_IMUL) + if (insn_type == TYPE_IMUL || insn_type == TYPE_IDIV) return 0; #define SLOW_FP(dep_type) \ @@ -7902,7 +7902,7 @@ ultrasparc_sched_reorder (dump, sched_verbose, ready, n_ready) { /* If the pipeline is (still) empty and we have any single group insns, get them out now as this is a good time. */ - rtx *ip = ultra_find_type ((TMASK (TYPE_RETURN) | + rtx *ip = ultra_find_type ((TMASK (TYPE_RETURN) | TMASK (TYPE_IDIV) | TMASK (TYPE_IMUL) | TMASK (TYPE_CMOVE) | TMASK (TYPE_MULTI) | TMASK (TYPE_MISC)), ready, this_insn); diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index 0ae0f83..451abf8 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -82,6 +82,7 @@ ;; Insn type. +;; If you add any new type here, please update ultrasparc_sched_reorder too. (define_attr "type" "ialu,compare,shift,load,sload,store,uncond_branch,branch,call,sibcall,call_no_delay_slot,return,imul,idiv,fpload,fpstore,fp,fpmove,fpcmove,fpcmp,fpmul,fpdivs,fpdivd,fpsqrts,fpsqrtd,cmove,multi,misc" (const_string "ialu")) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 28eeb14b..8aa2757 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2002-01-16 Jakub Jelinek <jakub@redhat.com> + * gcc.dg/ultrasp4.c: New test. + +2002-01-16 Jakub Jelinek <jakub@redhat.com> + * gcc.dg/20020116-2.c: New test. 2002-01-15 Geoffrey Keating <geoffk@redhat.com> diff --git a/gcc/testsuite/gcc.dg/ultrasp4.c b/gcc/testsuite/gcc.dg/ultrasp4.c new file mode 100644 index 0000000..b421688 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ultrasp4.c @@ -0,0 +1,13 @@ +/* Simplified from PR target/5309. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-options "-O2 -m64 -mcpu=ultrasparc" { target sparc64-*-* } } */ +/* { dg-options "-O2 -m64 -mcpu=ultrasparc" { target sparcv9-*-* } } */ +/* { dg-options "-O2" { target sparc-*-solaris2.[0-6] } } */ +/* { dg-options "-O2" { target sparc-*-solaris2.[0-6].* } } */ + +long bar (unsigned int); +long foo (long x, unsigned int y) +{ + return *(((long *) (bar (y) - 1)) + 1 + (x >> 2) % 359); +} |