Running bootstrap-ubsan on ppc64le shows many instances of:

  libcpp/lex.c:552:30: runtime error: load of misaligned address
  0x01001f31d37a for type 'const uchar', which requires 16 byte alignment

But the unaligned vector loads are intended in this case, because they
are preferable to forced-alignment on POWER8. So just silence the ubsan
errors.

Tested with bootstrap-ubsan on ppc64le.
OK for trunk?

Thanks.

2015-03-02  Markus Trippelsdorf  <mar...@trippelsdorf.de>

        PR target/65261
        * lex.c (init_vectorized_lexer): Silence ubsan errors.

diff --git a/libcpp/lex.c b/libcpp/lex.c
index 4638510..f7dbe27 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -519,6 +519,7 @@ init_vectorized_lexer (void)
    and VSX unaligned loads (when VSX is available).  This is otherwise
    the same as the pre-GCC 5 version.  */
 
+__attribute__ ((no_sanitize_undefined))
 static const uchar *
 search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
 {
-- 
Markus

Reply via email to