This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix some undefined behavior spots in gcc sources (PR c/53968)
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, John Regehr <regehr at cs dot utah dot edu>
- Date: Mon, 13 Aug 2012 20:47:47 +0100
- Subject: Re: [PATCH] Fix some undefined behavior spots in gcc sources (PR c/53968)
- References: <20120813120134.GJ1999@tucnak.redhat.com>
Jakub Jelinek <jakub@redhat.com> writes:
> --- gcc/simplify-rtx.c.jj 2012-08-10 15:49:20.000000000 +0200
> +++ gcc/simplify-rtx.c 2012-08-13 09:51:43.628508537 +0200
> @@ -66,7 +66,7 @@ static rtx simplify_binary_operation_1 (
> static rtx
> neg_const_int (enum machine_mode mode, const_rtx i)
> {
> - return gen_int_mode (- INTVAL (i), mode);
> + return gen_int_mode (-(unsigned HOST_WIDE_INT) INTVAL (i), mode);
Really minor, but UINTVAL would be nicer.
Richard