On 07/24/2018 12:11 PM, Richard Sandiford wrote:
> This PR shows a pathological case in which we try SLP vectorisation on
> dead code. We record that 0 bits of the result are enough to satisfy
> all users (which is true), and that led to precision being 0 in:
>
> static unsigned int
> vect_element_precision (unsigned int precision)
> {
> precision = 1 << ceil_log2 (precision);
> return MAX (precision, BITS_PER_UNIT);
> }
>
> ceil_log2 (0) returned 64 rather than 0, leading to 1 << 64, which is UB.
>
> Tested on aarch64-linux-gnu, aarch64_be-elf and x86_64-linux-gnu.
> OK to install?
>
> Richard
>
>
> 2018-07-24 Richard Sandiford <richard.sandif...@arm.com>
>
> gcc/
> * hwint.c (ceil_log2): Fix comment. Return 0 for 0.
OK
Jeff