This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: make genemit / genrecog emit L / LL suffixes
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 28 Jun 2002 13:17:12 +0100
- Subject: RFA: make genemit / genrecog emit L / LL suffixes
- Organization: SuperH UK Ltd.
--
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330
genemit / genrecog emit long / long long literals as int literals,
thus causing potentially a lot of warnings, and sometimes even
changing the signedness of the constant.
This patch makes them emit L / LL suffixes when HOST_WIDE_INT is not
the same size as an integer.
Fri Jun 28 13:04:33 2002 J"orn Rennecke <joern.rennecke@superh.com>
* hwint.c (define HOST_WIDE_INT_PRINT_DEC_C): New define.
* genrecog.c (write_switch, write_cond): Use it.
* genemit.c (gen_exp): Likewise.
Index: hwint.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/hwint.h,v
retrieving revision 1.11
diff -p -r1.11 hwint.h
*** hwint.h 10 Dec 2001 01:56:37 -0000 1.11
--- hwint.h 28 Jun 2002 12:04:26 -0000
***************
*** 72,82 ****
--- 72,85 ----
#ifndef HOST_WIDE_INT_PRINT_DEC
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
# define HOST_WIDE_INT_PRINT_DEC "%d"
+ # define HOST_WIDE_INT_PRINT_DEC_C "%d"
# else
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
# define HOST_WIDE_INT_PRINT_DEC "%ld"
+ # define HOST_WIDE_INT_PRINT_DEC_C "%lldL"
# else
# define HOST_WIDE_INT_PRINT_DEC "%lld"
+ # define HOST_WIDE_INT_PRINT_DEC_C "%lldLL"
# endif
# endif
#endif /* ! HOST_WIDE_INT_PRINT_DEC */
Index: genrecog.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genrecog.c,v
retrieving revision 1.118
diff -p -r1.118 genrecog.c
*** genrecog.c 11 Jun 2002 12:22:11 -0000 1.118
--- genrecog.c 28 Jun 2002 12:04:27 -0000
*************** write_switch (start, depth)
*** 1944,1950 ****
case DT_elt_one_int:
case DT_elt_zero_wide:
case DT_elt_zero_wide_safe:
! printf (HOST_WIDE_INT_PRINT_DEC, p->tests->u.intval);
break;
default:
abort ();
--- 1944,1950 ----
case DT_elt_one_int:
case DT_elt_zero_wide:
case DT_elt_zero_wide_safe:
! printf (HOST_WIDE_INT_PRINT_DEC_C, p->tests->u.intval);
break;
default:
abort ();
*************** write_cond (p, depth, subroutine_type)
*** 2003,2009 ****
case DT_elt_zero_wide:
case DT_elt_zero_wide_safe:
printf ("XWINT (x%d, 0) == ", depth);
! printf (HOST_WIDE_INT_PRINT_DEC, p->u.intval);
break;
case DT_veclen_ge:
--- 2003,2009 ----
case DT_elt_zero_wide:
case DT_elt_zero_wide_safe:
printf ("XWINT (x%d, 0) == ", depth);
! printf (HOST_WIDE_INT_PRINT_DEC_C, p->u.intval);
break;
case DT_veclen_ge:
Index: genemit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genemit.c,v
retrieving revision 1.75
diff -p -r1.75 genemit.c
*** genemit.c 11 Jun 2002 12:22:01 -0000 1.75
--- genemit.c 28 Jun 2002 12:06:53 -0000
*************** gen_exp (x, subroutine_type, used)
*** 246,252 ****
else
{
printf ("GEN_INT (");
! printf (HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
printf (")");
}
return;
--- 246,252 ----
else
{
printf ("GEN_INT (");
! printf (HOST_WIDE_INT_PRINT_DEC_C, INTVAL (x));
printf (")");
}
return;