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, ira] Make ira printf type correct


On Tue, Jun 10, 2008 at 01:19:52PM -0400, Michael Meissner wrote:
> I tried to bootstrap the ira compiler on a 32-bit Red Hat system, and it did
> not bootstrap due to a type conflict between a fprintf that used %ld to print
> out types that are int.  This patch fixes the immediate problem, but perhaps it
> is better to cast the types to long before doing the multiplies in case of
> overflow.

This will break 64-bit builds.  As we can't use %zd, because we still
support pre-ISO C99 hosts, I'm afraid casting both arguments to (long)
is the way to go.

> 2008-06-10  Michael Meissner  <michael.meissner@amd.com>
> 
> 	* ira-conflicts.c (build_conflict_bit_table): Make tracing fprintf
> 	type correct.
> 
> Index: gcc/ira-conflicts.c
> ===================================================================
> --- gcc/ira-conflicts.c	(revision 136625)
> +++ gcc/ira-conflicts.c	(working copy)
> @@ -112,7 +112,7 @@ build_conflict_bit_table (void)
>    if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL)
>      fprintf
>        (ira_dump_file,
> -       "+++Allocating %ld bytes for conflict table (uncompressed size %ld)\n",
> +       "+++Allocating %u bytes for conflict table (uncompressed size %u)\n",
>         allocated_words_num * sizeof (INT_TYPE),
>         allocno_set_words * allocnos_num * sizeof (INT_TYPE));
>    for (i = 0; i < max_point; i++)

	Jakub


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