HomePhabricator

Prevent -Wcast-align in sha256_shani.cpp

Description

Prevent -Wcast-align in sha256_shani.cpp

Summary:
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.

Test Plan:
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.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6279

Details

Provenance
FabienAuthored on May 28 2020, 13:57
FabienPushed on May 29 2020, 11:28
Reviewer
Restricted Project
Differential Revision
D6279: Prevent -Wcast-align in sha256_shani.cpp
Parents
rABC064404306ceb: Disable some more leveldb warnings
Branches
Unknown
Tags
Unknown