]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
i386: Use TESTB instead of TESTL in ____longjmp_chk()
authorUros Bizjak <ubizjak@gmail.com>
Mon, 18 Aug 2025 09:19:47 +0000 (11:19 +0200)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 20 Aug 2025 18:48:17 +0000 (11:48 -0700)
There is no need to use TESTL when checking the least-significant bit
with a TEST instruction. Use TESTB, which is three bytes shorter:

   f6 44 24 04 01          testb  $0x1,0x4(%esp)

vs:

   f7 44 24 04 01 00 00    testl  $0x1,0x4(%esp)
   00

for the same effect.

No functional changes intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: H.J.Lu <hjl.tools@gmail.com>
Cc: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
sysdeps/unix/sysv/linux/i386/____longjmp_chk.S

index e468d346d6c29c3bfd2ad54aa27bead3376c7f0b..3e09f15662d5635bd15922aefc099a600e1a1208 100644 (file)
@@ -67,7 +67,7 @@ ENTRY (____longjmp_chk)
        /* Without working sigaltstack we cannot perform the test.  */
        test    %eax, %eax
        jne     .Lok2
-       testl   $1, 4(%esp)
+       testb   $1, 4(%esp)
        jz      .Lfail
 
        movl    (%esp), %eax