This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libgcc2.h patch breaks c4x target
- To: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>, gcc-bugs at gcc dot gnu dot org
- Subject: Re: libgcc2.h patch breaks c4x target
- From: Stephane Carrez <Stephane dot Carrez at worldnet dot fr>
- Date: Sat, 23 Sep 2000 01:44:26 +0200
- References: <14794.42081.176209.235806@ongaonga.elec.canterbury.ac.nz>
Hi Michael,
Michael Hayes a écrit :
>
> The following patch breaks complilation of libgcc2.c for the C4x
> target. Can you please explain what exactly the problem was
> that required this patch so that we can come up with a compromise.
>
> Thanks, Michael.
>
> 2000-09-10 Stephane Carrez <Stephane.Carrez@worldnet.fr>
>
> * libgcc2.h: Use LONG_LONG_TYPE_SIZE instead of MIN_UNITS_PER_WORD
> to decide whether 64-bit support must be generated.
>
The problem I had was that the 64-bit operations were not generated.
For the 68hc11, I have the following configuration:
BITS_PER_UNIT = 8
UNITS_PER_WORD = 2
LONG_LONG_TYPE_SIZE = 64
and because UNITS_PER_WORD is not 4, the 64-bit operations were not enabled.
It seems that the c4x is defined with:
BITS_PER_UNIT = 32
UNITS_PER_WORD = 1
LONG_LONG_TYPE_SIZE = 64
I can propose a simple fix (verified on i386 & 68hc11) that fixes the test
to check for UNITS_PER_WORD > 1 in addition to LONG_LONG_TYPE_SIZE > 32.
It should fix your problem.
Stephane
2000-09-23 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* libgcc2.h: When checking LONG_LONG_TYPE_SIZE make sure that
MIN_UNITS_PER_WORD > 1.
--- ../cygnus/gcc/gcc/libgcc2.h Sun Sep 10 16:52:09 2000
+++ gcc/gcc/libgcc2.h Sat Sep 23 01:24:30 2000
@@ -163,7 +163,8 @@
#define UDWtype UTItype
#define __NW(a,b) __ ## a ## di ## b
#define __NDW(a,b) __ ## a ## ti ## b
-#elif MIN_UNITS_PER_WORD > 2 || LONG_LONG_TYPE_SIZE > 32
+#elif MIN_UNITS_PER_WORD > 2 \
+ || (MIN_UNITS_PER_WORD > 1 && LONG_LONG_TYPE_SIZE > 32)
#define W_TYPE_SIZE (4 * BITS_PER_UNIT)
#define Wtype SItype
#define UWtype USItype