This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [3.0.1 PATCH] S/390 correct LONG_MAX value for 64-bit


Alexandre Oliva wrote:
> 
> On Aug 10, 2001, Ulrich Weigand <weigand@immd1.informatik.uni-erlangen.de> wrote:
> 
> > 2001-08-10  Ulrich Weigand  <uweigand@de.ibm.com>
>  
> >  	* glimits.h (__LONG_MAX__): Add s390x as 64-bit architecture.
> 
> We've been trying to avoid adding more exceptions to that header
> file.  The solution I was advised to adopt was to define __LONG_MAX__
> in CPP_PREDEFINES or CPP_SPEC.

Ah, I see.  Yes, that makes more sense ...

The patch below reverts the glimits.h change, and defines __LONG_MAX__
in CPP_PREDEFINES for s390x.  OK to apply to mainline?

Mark, I'm not sure what to do on the branch; on the one hand this 
would be an 'unnecessary patch', on the other hand it reverts another
patch that would have been unnecesary if I'd done it right to start
with ...  It's your call.

Bye,
Ulrich



2001-08-11  Ulrich Weigand  <uweigand@de.ibm.com>:

	* glimits.h: Remove the __LONG_MAX__ special case for s390x.

	* config/s390/linux64.h: Define __LONG_MAX__ in CPP_PREDEFINES.


Index: gcc/glimits.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/glimits.h,v
retrieving revision 1.14
diff -c -p -r1.14 glimits.h
*** glimits.h	2001/08/10 22:54:59	1.14
--- glimits.h	2001/08/11 21:17:27
***************
*** 67,73 ****
  /* 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) || defined (__s390x__)
  #define __LONG_MAX__ 9223372036854775807L
  #else
  #define __LONG_MAX__ 2147483647L
--- 67,73 ----
  /* 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)
  #define __LONG_MAX__ 9223372036854775807L
  #else
  #define __LONG_MAX__ 2147483647L
Index: gcc/config/s390/linux64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/linux64.h,v
retrieving revision 1.2
diff -c -p -r1.2 linux64.h
*** linux64.h	2001/08/11 20:56:12	1.2
--- linux64.h	2001/08/11 21:17:30
*************** Boston, MA 02111-1307, USA.  */
*** 36,43 ****
  /* Names to predefine in the preprocessor for this target machine.  */
  
  #undef CPP_PREDEFINES
! #define CPP_PREDEFINES "-Dlinux -Asystem(linux) -Acpu(s390) -Amachine(s390) -D__s390x__ -Asystem(unix) -Dunix -D__ELF__"
! 
  
  #undef	LINK_SPEC
  #ifdef CROSS_COMPILE
--- 36,45 ----
  /* Names to predefine in the preprocessor for this target machine.  */
  
  #undef CPP_PREDEFINES
! #define CPP_PREDEFINES \
!   "-Dlinux -Asystem(linux) -Acpu(s390) -Amachine(s390) -D__s390x__ \
!    -Asystem(unix) -Dunix -D__ELF__ \
!    -D__LONG_MAX__=9223372036854775807L"
  
  #undef	LINK_SPEC
  #ifdef CROSS_COMPILE

-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]