Skip to content

Commit 348b376

Browse files
committed
Silence FPC's below-esp warning in the SHA-256 i386 kernels
FPC flags "lea esp, [esp - $60]" with "Use of -offset(%esp), access may cause a crash or value may be lost" in the SSE2/SSSE3/AVX SHA-256 i386 kernels. The warning is a false positive - lea is address arithmetic, not a memory access; the line is the CRYPTOGAMS flag-neutral spelling of a stack allocation and nothing ever dereferences below esp. Spelled it "sub esp, $60" instead: no flag consumer lives between the allocation and the next flag-setting instruction at any of the three sites, so the forms are equivalent - and the recurring build noise is gone.
1 parent 769e5e5 commit 348b376

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

HashLib/src/Include/Simd/SHA256/SHA256CompressAvx_i386.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
mov dword ptr [esp + $4], edi
2929
mov dword ptr [esp + $8], eax
3030
mov dword ptr [esp + $C], ebx
31-
lea esp, [esp - $60]
31+
sub esp, $60
3232
db $C5, $FC, $77 // vzeroall
3333
mov eax, dword ptr [esi]
3434
mov ebx, dword ptr [esi + $4]

HashLib/src/Include/Simd/SHA256/SHA256CompressSse2_i386.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
mov dword [esp + $4], edi
2727
mov dword [esp + $8], eax
2828
mov dword [esp + $C], ebx
29-
lea esp, [esp - $60]
29+
sub esp, $60
3030
mov eax, dword [esi]
3131
mov ebx, dword [esi + $4]
3232
mov ecx, dword [esi + $8]

HashLib/src/Include/Simd/SHA256/SHA256CompressSsse3_i386.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
mov dword [esp + $4], edi
2929
mov dword [esp + $8], eax
3030
mov dword [esp + $C], ebx
31-
lea esp, [esp - $60]
31+
sub esp, $60
3232
mov eax, dword [esi]
3333
mov ebx, dword [esi + $4]
3434
mov ecx, dword [esi + $8]

0 commit comments

Comments
 (0)