This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, ira] Make ira printf type correct
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Michael Meissner <michael dot meissner at amd dot com>, vmakarov at redhat dot com, gcc-patches at gcc dot gnu dot org, christophe dot harle at amd dot com
- Date: Tue, 10 Jun 2008 13:32:16 -0400
- Subject: Re: [PATCH, ira] Make ira printf type correct
- References: <20080610171952.GA14731@mmeissner-gold.amd.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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