Open ec04fc15-fa35-46f2-80e1-5d271f2ef708 opened 6 years ago
Testcase:
struct [[gnu::packed]] B { virtual void f(); }; static_assert(alignof(B) == 1); void f(B &b) { b.f(); }
The static_assert passes, and yet Clang generates an aligned vptr load:
%3 = load %struct.B*, %struct.B** %2, align 8, !dbg !14
GCC appears to correctly handle this case:
https://godbolt.org/g/GJkafy
@llvm/issue-subscribers-clang-codegen
Author: None (ec04fc15-fa35-46f2-80e1-5d271f2ef708)
Extended Description
Testcase:
struct [[gnu::packed]] B { virtual void f(); }; static_assert(alignof(B) == 1); void f(B &b) { b.f(); }
The static_assert passes, and yet Clang generates an aligned vptr load:
%3 = load %struct.B*, %struct.B** %2, align 8, !dbg !14
GCC appears to correctly handle this case:
https://godbolt.org/g/GJkafy