From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23879 invoked by alias); 1 Jul 2014 15:51:25 -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 23731 invoked by uid 89); 1 Jul 2014 15:51:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Jul 2014 15:51:19 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Tue, 01 Jul 2014 16:51:16 +0100 Received: from [10.1.201.52] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 1 Jul 2014 16:51:15 +0100 Message-ID: <53B2D8F2.9040407@arm.com> Date: Tue, 01 Jul 2014 15:51:00 -0000 From: Yufeng Zhang User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" , Marcus Shawcroft Subject: [PATCH, AArch64, Testsuite] Specify -fno-use-caller-save for func-ret* tests X-MC-Unique: 114070116511605401 Content-Type: multipart/mixed; boundary="------------040006000204090107030301" X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00058.txt.bz2 This is a multi-part message in MIME format. --------------040006000204090107030301 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Content-length: 920 Hi, This patch resolves a conflict between the aapcs64 test framework for=20 func-ret tests and the optimization option -fuse-caller-save, which was=20 enabled by default at -O1 or above recently. Basically, the test framework has an inline-assembly based mechanism in=20 place which invokes the test facility function right on the return of a=20 tested function. The compiler with -fuse-caller-save is unable to=20 identify the unconventional call graph and carries out the optimization=20 regardless. Adding explicit LR clobbering field to the inline assembly doesn't solve=20 the issue as the compiler would simply generate extra save/store of LR=20 in the prologue/epilogue. OK for the trunk? Thanks, Yufeng gcc/testsuite/ * gcc.target/aarch64/aapcs64/aapcs64.exp: (additional_flags_for_func_ret): New variable based on $additional_flags plus -fno-use-caller-save. (func-ret-*.c): Use the new variable.= --------------040006000204090107030301 Content-Type: text/plain; name=patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="patch" Content-length: 880 diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/aapcs64.exp b/gcc/tes= tsuite/gcc.target/aarch64/aapcs64/aapcs64.exp index 195f977..fdfbff1 100644 --- a/gcc/testsuite/gcc.target/aarch64/aapcs64/aapcs64.exp +++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/aapcs64.exp @@ -48,11 +48,15 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/va= _arg-*.c]] { } =20 # Test function return value. +# Disable -fuse-caller-save to prevent the compiler from generating +# conflicting code. +set additional_flags_for_func_ret $additional_flags +append additional_flags_for_func_ret " -fno-use-caller-save" foreach src [lsort [glob -nocomplain $srcdir/$subdir/func-ret-*.c]] { if {[runtest_file_p $runtests $src]} { c-torture-execute [list $src \ $srcdir/$subdir/abitest.S] \ - $additional_flags + $additional_flags_for_func_ret } } =20= --------------040006000204090107030301--