From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 700A5385842E for ; Wed, 15 Dec 2021 09:01:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 700A5385842E Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-230-WPfLw5TLN_etkh2NysUtKQ-1; Wed, 15 Dec 2021 04:01:46 -0500 X-MC-Unique: WPfLw5TLN_etkh2NysUtKQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E1E0E1935780; Wed, 15 Dec 2021 09:01:44 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.17.223]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0810F45D88; Wed, 15 Dec 2021 09:01:43 +0000 (UTC) From: Florian Weimer To: Mathieu Desnoyers Cc: libc-alpha Subject: Re: __thread_pointer on powerpc References: <1297615534.32054.1639534577971.JavaMail.zimbra@efficios.com> Date: Wed, 15 Dec 2021 10:01:41 +0100 In-Reply-To: <1297615534.32054.1639534577971.JavaMail.zimbra@efficios.com> (Mathieu Desnoyers's message of "Tue, 14 Dec 2021 21:16:17 -0500 (EST)") Message-ID: <87a6h2s0lm.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Dec 2021 09:01:50 -0000 * Mathieu Desnoyers: > Hi Florian, > > In the recent patchset introducing rseq support in glibc, __thread_pointer > is wired up for powerpc. > > Based on my interpretation of > > https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/Local-Register-Variables.html > > it appears that using "register void *__result asm ("r2")" is not sufficient > to guarantee that the compiler will indeed use this register. It's documented > as being just a hint that the compiler is free to optimize away. > > I suspect we may want to add something like: > > asm ("" : "=r" (__result)); > > just after the variable definition, to force the compiler to use this variable > as output to an inline asm. Good point. I think we should use a global register variable instead. I will try to fix this. Thanks, Florian