This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR63426 Fix various signed integer overflows
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Markus Trippelsdorf <markus at trippelsdorf dot de>
- Cc: gcc-patches at gcc dot gnu dot org, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Thu, 20 Nov 2014 16:56:44 +0100
- Subject: Re: [PATCH] PR63426 Fix various signed integer overflows
- Authentication-results: sourceware.org; auth=none
- References: <20141120132752 dot GJ344 at x4>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Nov 20, 2014 at 02:27:52PM +0100, Markus Trippelsdorf wrote:
> 2014-11-20 Markus Trippelsdorf <markus@trippelsdorf.de>
>
> * emit-rtl.c (const_wide_int_htab_hash): Likewise.
> * loop-iv.c (determine_max_iter): Likewise.
> (iv_number_of_iterations): Likewise.
> * tree-ssa-loop-ivopts.c (get_computation_cost_at): Likewise.
> * varasm.c (get_section_anchor): Likewise.
Ok, with one small change:
> --- a/gcc/varasm.c
> +++ b/gcc/varasm.c
> @@ -7188,7 +7188,7 @@ get_section_anchor (struct object_block *block, HOST_WIDE_INT offset,
> offset = 0;
> else
> {
> - bias = 1 << (GET_MODE_BITSIZE (ptr_mode) - 1);
> + bias = (unsigned HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (ptr_mode) - 1);
Please use HOST_WIDE_INT_1U instead of (unsigned HOST_WIDE_INT) 1.
Jakub