PR 51094 - fprint_w() in output_addr_const() reinstated

Andreas Schwab schwab@linux-m68k.org
Thu Jul 12 07:35:00 GMT 2012


Dimitrios Apostolou <jimis@gmx.net> writes:

> @@ -3849,6 +3850,32 @@ sprint_ul_rev (char *s, unsigned long va
>    return i;
>  }
>  
> +/* Write a signed HOST_WIDE_INT as decimal to a file, fast. */
> +
> +void
> +fprint_w (FILE *f, HOST_WIDE_INT value)
> +{
> +  /* python says: len(str(2**64)) == 20 */
> +  char s[20];

>From gnulib:

/* Bound on length of the string representing an unsigned integer
   value representable in B bits.  log10 (2.0) < 146/485.  The
   smallest value of B where this bound is not tight is 2621.  */
#define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Gcc-patches mailing list