From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id 2A5883858C2C for ; Mon, 29 Aug 2022 19:00:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A5883858C2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x235.google.com with SMTP id s199so11461425oie.3 for ; Mon, 29 Aug 2022 12:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc; bh=9RQIt/luRTYkR2YJW8Hw3VukhhjUizOp7oewykOeySg=; b=NMTJqYy8Htt06u7C5fyXi5Jeou+s0ro3qH2+EmdU+PVWF2BczLO36rXizwsqpekFD7 94UEzfp7hFKXozMTyluXBorWpurVev74pUSlmsHitlNgifdvBDPHeI7yeiaOBQZ044sg UhjdXMSuvEt9V7r3A9drlL3DCso5x9MoLAm1qomzDGiOvTYY6MXNTY4cX4TSFm0pVk/M M/v6HPWq7PNFxDN73seYo9Dwjwp1gOzQpF9ANh5Kb5E5m3pCfq/uCPuUdrftORUy53+6 iUi874VzHtS/zzEi2S22Th68XsyvyqsS5D+fVEsN+CM3d+30IPYhY58FQpo2KsW/qbVr Bq3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc; bh=9RQIt/luRTYkR2YJW8Hw3VukhhjUizOp7oewykOeySg=; b=mKqhK++4qeduh0JB9EFHshh26fEvmrleg1MA8gTmGipoY0XoHnCh8MXdcJ7F0LDiqf yRwIDvmkksWXdH59nLAr7sSQHF+9w069eQGfhqDLw4T2nLQQ6s8dUFSfsYUQRZX9G1Ea nLBgj6BGiDBQ7D9OvGGbNp8yhoaWjbsmXRNV03X9JEgIzw1nyvJczBff2Ylp5iefpZ0T 5qoFB/adgOqvBkdVNrJHpFqBmRL75IpOSNkDtyFl/HWm+KJTQzmY4VKDUWka1r3+HRHB MOa1fAh9J8e7j460+b1hjl+0nT7iF/qQex7w/DkPYlGsEPldD9taDuJa4yACnmFNsPFi /2+Q== X-Gm-Message-State: ACgBeo0cnsJs4+DakHF4CJXJHw921Mz72PUPbJF+CMdDG4iftNbWBybu Py26T33gkH0wShcwR+IMNLkQJTMa18cXEw== X-Google-Smtp-Source: AA6agR4KjAV2fmkQSHofhh/mUgloFSyWdF4xDnwm+X9iaXkCJgIsX9m7SY6MxrU+r2IdbSY3Efy7PA== X-Received: by 2002:a05:6808:e8a:b0:337:9846:931a with SMTP id k10-20020a0568080e8a00b003379846931amr8159895oil.215.1661799615538; Mon, 29 Aug 2022 12:00:15 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:745e:ead4:6d93:6ff:7ce5]) by smtp.gmail.com with ESMTPSA id u11-20020a056870440b00b0010173875df2sm6266955oah.58.2022.08.29.12.00.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Aug 2022 12:00:15 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH] nptl: x86_64: Use stackinfo.h definition for CURRENT_STACK_FRAME Date: Mon, 29 Aug 2022 16:00:12 -0300 Message-Id: <20220829190012.946402-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: It avoids the possible warning of uninitialized 'frame' variable when building with clang: ../sysdeps/nptl/jmp-unwind.c:27:42: error: variable 'frame' is uninitialized when used here [-Werror,-Wuninitialized] __pthread_cleanup_upto (env->__jmpbuf, CURRENT_STACK_FRAME); It increases the generated code by one instruction: --- master +++ patch @@ -25068,11 +25068,11 @@ Disassembly of section .text: 3db1b: 00 00 3db1d: 48 89 44 24 08 mov %rax,0x8(%rsp) 3db22: 31 c0 xor %eax,%eax - 3db24: 48 8b 44 24 08 mov 0x8(%rsp),%rax - 3db29: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax - 3db30: 00 00 - 3db32: 75 0c jne 3db40 <_longjmp_unwind+0x30> - 3db34: 48 89 e6 mov %rsp,%rsi + 3db24: 48 89 e6 mov %rsp,%rsi + 3db27: 48 8b 44 24 08 mov 0x8(%rsp),%rax + 3db2c: 64 48 2b 04 25 28 00 sub %fs:0x28,%rax + 3db33: 00 00 + 3db35: 75 09 jne 3db40 <_longjmp_unwind+0x30> 3db37: 48 83 c4 18 add $0x18,%rsp 3db3b: e9 60 31 05 00 jmp 90ca0 <__GI___pthread_cleanup_upto> 3db40: e8 4b ec 0e 00 call 12c790 <__stack_chk_fail> Checked on x86_64-linux-gnu. --- sysdeps/x86/nptl/pthreaddef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/x86/nptl/pthreaddef.h b/sysdeps/x86/nptl/pthreaddef.h index 63fdbcb27c..3ff95efee6 100644 --- a/sysdeps/x86/nptl/pthreaddef.h +++ b/sysdeps/x86/nptl/pthreaddef.h @@ -42,7 +42,7 @@ #ifdef __x86_64__ /* The frame pointer is not usable. */ # define CURRENT_STACK_FRAME \ - ({ register char *frame __asm__("rsp"); frame; }) + ({ void *p__; asm volatile ("mov %%" RSP_REG ", %0" : "=r" (p__)); p__; }) #else # define CURRENT_STACK_FRAME __builtin_frame_address (0) #endif -- 2.34.1