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] PR63426 Fix various signed integer overflows


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


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