This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Fix host LP64 bug in mips.c
- From: Matt Thomas <matt at 3am-software dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 25 Oct 2003 15:01:18 -0700
- Subject: [patch] Fix host LP64 bug in mips.c
Compiling unwind-dw2.c from libgcc on an amd64 system generates
the following asm errors:
/u1/tools/bin/mipsel--netbsd-gcc -O2 --save-temps -Werror \
-I/usr/src/gnu/lib/libgcc3 -I/usr/src/gnu/usr.bin/gcc3/arch/mipsel \
-DIN_GCC -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
-I/usr/src/gnu/dist/gcc/gcc -I/usr/src/gnu/dist/gcc/gcc/. \
-I/usr/src/gnu/dist/gcc/gcc/config -I/usr/src/gnu/dist/gcc/gcc/../include \
-I/usr/src/gnu/dist/gcc/gcc/cp -I/usr/src/gnu/lib/libstdc++-v3/arch/mipsel \
-I. -nostdinc -isystem /u1/pmax/root/usr/include \
-c -fPIC -DPIC -fexceptions -o unwind-dw2.o
/usr/src/gnu/dist/gcc/gcc/unwind-dw2.c
unwind-dw2.s: Assembler messages:
unwind-dw2.s:3475: Error: bad or irreducible absolute expression
unwind-dw2.s:3884: Error: bad or irreducible absolute expression
unwind-dw2.s:4032: Error: bad or irreducible absolute expression
unwind-dw2.s:4191: Error: bad or irreducible absolute expression
unwind-dw2.s:4390: Error: bad or irreducible absolute expression
Notice the sign extended fmask?
_Unwind_RaiseException:
.frame $sp,3096,$31 # vars= 2952, regs= 15/6, args=
24, extra= 8
.mask 0xd0ff00f0,-56
.fmask 0xfffffffffff00000,-8
The following patch avoids the sign extension by shift a long.
Index: mips.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.c,v
retrieving revision 1.336
diff -u -r1.336 mips.c
--- mips.c 19 Oct 2003 07:52:10 -0000 1.336
+++ mips.c 25 Oct 2003 21:55:56 -0000
@@ -6213,7 +6213,7 @@
if (mips_save_reg_p (regno))
{
fp_reg_size += FP_INC * UNITS_PER_FPREG;
- fmask |= ((1 << FP_INC) - 1) << (regno - FP_REG_FIRST);
+ fmask |= ((1L << FP_INC) - 1) << (regno - FP_REG_FIRST);
}
}
--
Matt Thomas email: matt@3am-software.com
3am Software Foundry www: http://3am-software.com/bio/matt/
Cupertino, CA disclaimer: I avow all knowledge of this message.