8 byte long for x86-64

Geoff Keating geoffk@geoffk.org
Wed Apr 4 11:11:00 GMT 2001


Bo Thorsen <bo@sonofthor.dk> writes:

> This small patch makes gcc use 8 bytes for longs on x86-64. It works and
> is already applied to the x86-64 specific tree, but Jan Hubicka wanted me
> to ask if there is a better way of doing this?
> 
> If this is the best way of doing it, please apply it. I'm probably unable
> to comment on it within the next week or so.
> 
> Bo.
> 
> 2001-04-04  Bo Thorsen  <bo@suse.de>
> 
> 	* glimits.h: 8 byte long for x86-64.
> 
> 
> Index: glimits.h
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/glimits.h,v
> retrieving revision 1.10
> diff -u -r1.10 glimits.h
> --- glimits.h	2000/07/21 00:47:27	1.10
> +++ glimits.h	2001/04/04 16:06:09
> @@ -64,7 +64,7 @@
>  /* Minimum and maximum values a `signed long int' can hold.
>     (Same as `int').  */
>  #ifndef __LONG_MAX__
> -#if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9)
> +#if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9) || defined (__x86_64__)
>  #define __LONG_MAX__ 9223372036854775807L
>  #else
>  #define __LONG_MAX__ 2147483647L

The better way to do it is to define __LONG_MAX__.  This is essential
if you want to have a switch that changes the size back, and it
simplifies the common header file.

-- 
- Geoffrey Keating <geoffk@geoffk.org>



More information about the Gcc-patches mailing list