This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix UB in expmed.c (PR middle-end/61903)
- From: Jeff Law <law at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 29 Aug 2014 14:08:04 -0600
- Subject: Re: [PATCH] Fix UB in expmed.c (PR middle-end/61903)
- Authentication-results: sourceware.org; auth=none
- References: <20140825192135 dot GL15033 at redhat dot com>
On 08/25/14 13:21, Marek Polacek wrote:
The following ought to fix two spots where an undefined behavior
can occur when compiling pr28045.c with instrumented compiler.
It does so by changing the type of V to an unsigned HOST_WIDE_INT
and performing the shift on unsigned HOST_WIDE_INT.
Hopefully it doesn't break anything...
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2014-08-25 Marek Polacek <email@example.com>
* expmed.c (store_fixed_bit_field_1): Shift UHWI 1 instead of HWI 1.
Change the type of V to unsigned HOST_WIDE_INT.