From 76098f45b8b1f2224eb25cf5d94450c6f4a1414c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 22 Sep 2018 22:46:45 +0200 Subject: [PATCH] RocksDB: workaround a compiler error on ppc64le storage/rocksdb/rdb_datadic.cc: In member function 'int myrocks::Rdb_key_def::unpack_integer(myrocks::Rdb_field_packing*, Field*, uchar*, myrocks::Rdb_string_reader*, myrocks::Rdb_string_reader*) const' storage/rocksdb/rdb_datadic.cc:1781:1: internal compiler error: Segmentation fault } on ppc64le, ubuntu bionic gcc 7.3.0 and debian stretch gcc 6.3.0 The error happens with -ftree-loop-vectorize when trying to vectorize a particular loop (see Rdb_key_def::unpack_integer()) Compiler gets confused by __attribute__((optimize("O0")) that comes from ha_rocksdb_proto.h. The intention of this __attribute__ was to prevent function from being inlined (see ha_rocksdb.cc). Let's use a more specific attribute that prevents inlining but does not confuse loop vectorizer. --- storage/rocksdb/ha_rocksdb_proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/rocksdb/ha_rocksdb_proto.h b/storage/rocksdb/ha_rocksdb_proto.h index deb65edddd3..08afd9780be 100644 --- a/storage/rocksdb/ha_rocksdb_proto.h +++ b/storage/rocksdb/ha_rocksdb_proto.h @@ -43,7 +43,7 @@ void rdb_handle_io_error(const rocksdb::Status status, #if defined(__clang__) MY_ATTRIBUTE((optnone)); #else - MY_ATTRIBUTE((optimize("O0"))); + MY_ATTRIBUTE((noinline,noclone)); #endif int rdb_normalize_tablename(const std::string &tablename, std::string *str)