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] Fix UB in expmed.c (PR middle-end/61903)


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  <polacek@redhat.com>

	PR middle-end/61903
	* expmed.c (store_fixed_bit_field_1): Shift UHWI 1 instead of HWI 1.
	Change the type of V to unsigned HOST_WIDE_INT.
OK.
Jeff


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