From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78510 invoked by alias); 2 May 2018 17:29:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 78498 invoked by uid 89); 2 May 2018 17:29:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=avr X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 May 2018 17:29:00 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 46E16C049D53; Wed, 2 May 2018 17:28:59 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-53.rdu2.redhat.com [10.10.112.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8CCB35BD65; Wed, 2 May 2018 17:28:57 +0000 (UTC) Subject: Re: [PATCH][AARCH64] PR target/84521 Fix frame pointer corruption with -fomit-frame-pointer with __builtin_setjmp To: Sudakshina Das , "gcc-patches@gcc.gnu.org" Cc: nd , James Greenhalgh , Marcus Shawcroft , Richard Earnshaw References: <4ee92fe8-3070-0129-59ad-40cbe0207822@arm.com> From: Jeff Law Openpgp: preference=signencrypt Autocrypt: addr=law@redhat.com; prefer-encrypt=mutual; keydata= xsBNBFkbIO8BCACVIqDhDVh9ur8C+zNV1J/cXfwvVDAUcphDEFl4jyHqZORK4Pd3Db8oWqLm Q8lOCr/VOS7lrCtdpVMQkLGOGA16oJ8g7hzhnojpjY09UjsoUiG7oKacuxj8skfp6SIx93Zl +iNY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R+niGjtnP5P/8PpRq8fP682pgzWwUCWRsg7wIbDAAKCRC8fP682pgzW3REB/9cT7iKRPg/ OK9bpLlllIEDM90IaKC79DQrv+fRudOR78cdV4XUwPSFnyHUsP3VJ4lDy5FhiKCwGie0BK53 EsxgMrLy1L8hboFdTE4Vi0xzCheMaMVp4hATDU29k1cuxu1VPpCa8E3mYeHjNV7ip0HN5L4D rfs8lRPJE/oM1vGs9DgQFZrCPPNRNGKC97BH+DHccesEJr7tSsQrkPkt0z/FTKr5wIM02vSx OJjgmcVbGB7dc2j/Sx8loXmuKnuKtM35668kUG8jeJvSQk3o/VHpD27bhl0rR68R2jN6G6kQ egMVb6dPu1Ius8rBE5rFw88J4JEb5q4hMNClWWUFHIdP Message-ID: Date: Wed, 02 May 2018 17:29:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <4ee92fe8-3070-0129-59ad-40cbe0207822@arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00104.txt.bz2 On 03/14/2018 11:40 AM, Sudakshina Das wrote: > Hi > > This patch is another partial fix for PR 84521. This is adding a > definition to one of the target hooks used in the SJLJ implemetation so > that AArch64 defines the hard_frame_pointer_rtx as the > TARGET_BUILTIN_SETJMP_FRAME_VALUE. As pointed out by Wilco there is > still a lot more work to be done for these builtins in the future. > > Testing: Bootstrapped and regtested on aarch64-none-linux-gnu and added > new test. > > Is this ok for trunk? > > Sudi > > > *** gcc/ChangeLog *** > > 2018-03-14  Sudakshina Das  > >     * builtins.c (expand_builtin_setjmp_receiver): Update condition >     to restore frame pointer. >     * config/aarch64/aarch64.h (DONT_USE_BUILTIN_SETJMP): Update >     comment. >     * config/aarch64/aarch64.c (aarch64_builtin_setjmp_frame_value): >     New. >     (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Define. > > *** gcc/testsuite/ChangeLog *** > > 2018-03-14  Sudakshina Das  > >     * gcc.c-torture/execute/pr84521.c: New test. So just to be clear, you do _not_ want the frame pointer restored here? Right? aarch64_builtin_setjmp_frame_value always returns hard_frame_pointer_rtx which will cause the generic code in builtins.c to not restore the frame pointer. Have you looked at other targets which define builtin_setjmp_frame_value to determine if they'll do the right thing. x86 and sparc are the most important. I see that arc, vax and avr also define that hook, but are obviously harder to test. jeff