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]
Other format: [Raw text]

Re: [PATCH] Fix mcf.c reliance on a GCC extension (PR bootstrap/38088)


On Wed, Nov 12, 2008 at 10:03:23PM +0100, Jakub Jelinek wrote:
> Hi!
> 
> Attached are 2 alternative patches to fix this.  According to
> hwint.h HOST_WIDEST_INT can be long, long long or __int64 and
> __LONG_LONG_MAX__ is a GCC built-in macro that most other compilers
> don't have.  Both have been (separately) bootstrapped/regtested
> on x86_64-linux.
> 
> Ok for trunk?

Yes.  I tend to prefer the second, but either on is ok.

> 	Jakub

> 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR bootstrap/38088
> 	* mcf.c (CAP_INFINITY): Use HOST_WIDEST_INT maximum, not GCC specific
> 	__LONG_LONG_MAX__.
> 
> --- gcc/mcf.c.jj	2008-09-30 16:57:11.000000000 +0200
> +++ gcc/mcf.c	2008-11-12 14:05:04.000000000 +0100
> @@ -56,7 +56,9 @@ along with GCC; see the file COPYING3.  
>  #include "profile.h"
> 
>  /* CAP_INFINITY: Constant to represent infinite capacity.  */
> -#define CAP_INFINITY __LONG_LONG_MAX__
> +#define CAP_INFINITY \
> +  ((HOST_WIDEST_INT) \
> +   ((((unsigned HOST_WIDEST_INT) 1) << (HOST_BITS_PER_WIDEST_INT - 1)) - 1))
> 
>  /* COST FUNCTION.  */
>  #define K_POS(b)        ((b))

> 2008-11-12  Andrew Haley  <aph@redhat.com>
> 
> 	PR bootstrap/38088
> 	* mcf.c (CAP_INFINITY): Use HOST_WIDEST_INT maximum, not GCC specific
> 	__LONG_LONG_MAX__.
> 
> --- gcc/mcf.c.jj	2008-09-30 16:57:11.000000000 +0200
> +++ gcc/mcf.c	2008-11-12 14:05:04.000000000 +0100
> @@ -56,7 +56,7 @@ along with GCC; see the file COPYING3.  
>  #include "profile.h"
> 
>  /* CAP_INFINITY: Constant to represent infinite capacity.  */
> -#define CAP_INFINITY __LONG_LONG_MAX__
> +#define CAP_INFINITY INTTYPE_MAXIMUM (HOST_WIDEST_INT)
> 
>  /* COST FUNCTION.  */
>  #define K_POS(b)        ((b))


-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com


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