diff options
author | Jim Wilson <wilson@cygnus.com> | 1997-09-02 19:37:05 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1997-09-02 12:37:05 -0700 |
commit | a6a503ed40ada59da0a8bcfe64adcffb407d8d8e (patch) | |
tree | 8ccb01cfb1412c49bbf01846c4ecc1fa3dff9956 /gcc/emit-rtl.c | |
parent | a94729bc72dad85c039ebd062dfdd72722994033 (diff) | |
download | gcc-a6a503ed40ada59da0a8bcfe64adcffb407d8d8e.zip gcc-a6a503ed40ada59da0a8bcfe64adcffb407d8d8e.tar.gz gcc-a6a503ed40ada59da0a8bcfe64adcffb407d8d8e.tar.bz2 |
Fix alpha-linux core dump reported by H.J. Lu.
* alpha/alpha.h (PREFERRED_RELOAD_CLASS): Return NO_REGS if NO_REGS
is passed in.
* emit-rtl.c (gen_lowpart_common): Add code to convert CONST_INT to
SFmode for 64 bit hosts.
From-SVN: r15035
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 650c01c..86948de 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -809,6 +809,26 @@ gen_lowpart_common (mode, x) return CONST_DOUBLE_FROM_REAL_VALUE (u.d, mode); } #endif + + /* We need an extra case for machines where HOST_BITS_PER_WIDE_INT is the + same as sizeof (double), such as the alpha. We only handle the + REAL_ARITHMETIC case, which is easy. Testing HOST_BITS_PER_WIDE_INT + is not strictly necessary, but is done to restrict this code to cases + where it is known to work. */ +#ifdef REAL_ARITHMETIC + else if (mode == SFmode + && GET_CODE (x) == CONST_INT + && GET_MODE_BITSIZE (mode) * 2 == HOST_BITS_PER_WIDE_INT) + { + REAL_VALUE_TYPE r; + HOST_WIDE_INT i; + + i = INTVAL (x); + r = REAL_VALUE_FROM_TARGET_SINGLE (i); + return CONST_DOUBLE_FROM_REAL_VALUE (r, mode); + } +#endif + /* Similarly, if this is converting a floating-point value into a single-word integer. Only do this is the host and target parameters are compatible. */ |