On 12/14/2015 01:29 AM, Jan Beulich wrote:
On 11.12.15 at 21:40, <l...@redhat.com> wrote:
On 12/11/2015 12:28 AM, Jan Beulich wrote:
gcc/c/
2015-12-10  Jan Beulich  <jbeul...@suse.com>

        * c-fold.c (c_fully_fold_internal): Also emit shift count
        warnings for vector types.
        * c-typeck.c (build_binary_op): Likewise.
Needs testcases for the added warnings.

My additional concern here would be that in build_binary_op, after your
change, we'll be setting doing_shift to true.  That in turn will enable
ubsan instrumentation of the shift.  Does ubsan work properly for vector
shifts?

You say that it may be safe with that other patch you replied to a
little later. I have no idea myself.
I think Paolo's change makes yours safe.

Essentially Paolo's change avoids the overflow sanitization if the type is not an integral type. Specifically in ubsan_instrument_shift tt will always be NULL, which in turn causes ubsan_instrument_shift to return NULL without generating any instrumentation.

So I think you just need to build some testcases for your change.
jeff

Reply via email to