There is a potential bug in vectorizable_live_operation.

Consider the case where the first op for stmt is valid, but the second is
null.
The first time through the for () loop, it will call out to
vect_is_simple_use () which will set dt.
The second time, because op is null, vect_is_simple_use () will not be
called.
However, dt is still set to a valid value, therefore the loop will
continue.

Note this is different from the case where the first op is null, which
will cause the loop not call vect_is_simple_use () and then return false.

It is possible that this was intentional, however that is not clear from
the code.

The fix is to simply ensure dt is initialized to a default value on each
iteration.


2015-09-07  Alan Hayward  alan.hayw...@arm.com
        * tree-vect-looop.c (vectorizable_live_operation): localize variable.


Cheers,
Alan

Attachment: avoid_issimple.patch
Description: Binary data

Reply via email to