This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR rtl-optimization/78596 - combine.c:12561:14: runtime error: left shift of negative value
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Markus Trippelsdorf <markus at trippelsdorf dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 1 Dec 2016 07:34:01 -0600
- Subject: Re: [PATCH] PR rtl-optimization/78596 - combine.c:12561:14: runtime error: left shift of negative value
- Authentication-results: sourceware.org; auth=none
- References: <20161201123429.GL25596@x4>
On Thu, Dec 01, 2016 at 01:34:29PM +0100, Markus Trippelsdorf wrote:
> Hopefully one last patch for UB in combine.c:
>
> combine.c:12561:14: runtime error: left shift of negative value -9
>
> Fixed by casting to unsigned, as usual.
>
> Tested on ppc64le.
> OK for trunk?
Sure, but please fix the indentation of that last new line (and of the
changelog, too, while you're at it ;-) )
Segher
> - const_op <<= INTVAL (XEXP (op0, 1));
> + const_op = (unsigned HOST_WIDE_INT) const_op
> + << INTVAL (XEXP (op0, 1));