Instructions such as _mm_loadu_si128 or _mm_storeu_si128 are
specialized for unaligned access (hence the 'u' suffix). Unfortunately
it triggers a false positive -Wcast-align with Clang.
This diff disables the warnings at the places where it is safe.
Details
Details
- Reviewers
deadalnix - Group Reviewers
Restricted Project - Commits
- rABC94dd82f1bc20: Prevent -Wcast-align in sha256_shani.cpp
With Clang as a compiler (tested with Clang 10), on a platform
supporting the SHA new instructions:
ninja
Check the warning is gone.
Run the Gitian builds.
I ran the benchmark 21 times and compared against master: there is no impact on performance.
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- fix_warning_cast_align_shani
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 11065 Build 20532: Default Diff Build & Tests Build 20531: Build without Wallet Build 20530: Build with clang-10 Build 20529: arc lint + arc unit
Event Timeline
Comment Actions
I think you should create a LoadInteger128Unaligned/StoreInteger128Unaligned an limit the pragma to these functions. Mark the static and always inline and you'll be set.
src/crypto/sha256_shani.cpp | ||
---|---|---|
100 ↗ | (On Diff #20680) | You need to make them static, not inline. |