diff options
| author | davem <davem@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-24 10:08:38 +0000 |
|---|---|---|
| committer | davem <davem@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-24 10:08:38 +0000 |
| commit | 0ceee13a2c661bf7c6835b2d68e2e628cd2f7537 (patch) | |
| tree | 0b57b1ced0947668bcdbc374a39f118f0c2008e8 /gcc | |
| parent | a46568a03752e6603f34f21d2fd0283e29423790 (diff) | |
| download | ppe42-gcc-0ceee13a2c661bf7c6835b2d68e2e628cd2f7537.tar.gz ppe42-gcc-0ceee13a2c661bf7c6835b2d68e2e628cd2f7537.zip | |
2002-06-24 David S. Miller <davem@redhat.com>
* config/sparc/sparc.c (INIT_TARGET_OPTABS): If ARCH64, set the
32-bit ABI libfuncs to NULL.
* expmed.c (expand_divmod): Do not set optab1/optab2 to the shift
optabs if op1 is const0_rtx.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54950 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/ChangeLog | 8 | ||||
| -rw-r--r-- | gcc/config/sparc/sparc.h | 11 | ||||
| -rw-r--r-- | gcc/expmed.c | 7 |
3 files changed, 24 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 717dcb08581..f3cdecc9a9e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2002-06-24 David S. Miller <davem@redhat.com> + + * config/sparc/sparc.c (INIT_TARGET_OPTABS): If ARCH64, set the + 32-bit ABI libfuncs to NULL. + + * expmed.c (expand_divmod): Do not set optab1/optab2 to the shift + optabs if op1 is const0_rtx. + 2002-06-24 Neil Booth <neil@daikokuya.co.uk> * cpptrad.c (scan_out_logical_line): Check recursing only when diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index cb556a31ac7..97f1a2d2606 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -2585,6 +2585,17 @@ do { \ sqrt_optab->handlers[(int) TFmode].libfunc \ = init_one_libfunc ("_Q_sqrt"); \ } \ + if (TARGET_ARCH64) \ + { \ + /* In the SPARC 64bit ABI, these libfuncs do not exist in the \ + library. Make sure the compiler does not emit calls to them \ + by accident. */ \ + sdiv_optab->handlers[(int) SImode].libfunc = NULL; \ + udiv_optab->handlers[(int) SImode].libfunc = NULL; \ + smod_optab->handlers[(int) SImode].libfunc = NULL; \ + umod_optab->handlers[(int) SImode].libfunc = NULL; \ + smul_optab->handlers[(int) SImode].libfunc = NULL; \ + } \ INIT_SUBTARGET_OPTABS; \ } while (0) diff --git a/gcc/expmed.c b/gcc/expmed.c index 8ef4fca585f..317dcc4ab54 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -3049,9 +3049,12 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp) not straightforward to generalize this. Maybe we should make an array of possible modes in init_expmed? Save this for GCC 2.7. */ - optab1 = (op1_is_pow2 ? (unsignedp ? lshr_optab : ashr_optab) + optab1 = ((op1_is_pow2 && op1 != const0_rtx) + ? (unsignedp ? lshr_optab : ashr_optab) : (unsignedp ? udiv_optab : sdiv_optab)); - optab2 = (op1_is_pow2 ? optab1 : (unsignedp ? udivmod_optab : sdivmod_optab)); + optab2 = ((op1_is_pow2 && op1 != const0_rtx) + ? optab1 + : (unsignedp ? udivmod_optab : sdivmod_optab)); for (compute_mode = mode; compute_mode != VOIDmode; compute_mode = GET_MODE_WIDER_MODE (compute_mode)) |

