From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27750 invoked by alias); 19 May 2017 08:51:24 -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 27657 invoked by uid 89); 19 May 2017 08:51:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:3628 X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 May 2017 08:51:20 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id D99C55C5; Fri, 19 May 2017 10:51:20 +0200 (CEST) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3DOds0nxP2Zr; Fri, 19 May 2017 10:51:18 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id E5BD85C3; Fri, 19 May 2017 10:51:17 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id v4J8pG29014693; Fri, 19 May 2017 10:51:16 +0200 (MEST) From: Rainer Orth To: Daniel Santos Cc: Mike Stump , gcc-patches , Bernd Edlinger Subject: Re: [PATCH 2/2] [testsuite] PR 80759 Remove gas extensions from do-test.S, fix other problems References: <3c867dc8-7d4a-ae82-c875-d03ff6d88776@pobox.com> <20170519063418.7836-2-daniel.santos@pobox.com> Date: Fri, 19 May 2017 08:54:00 -0000 In-Reply-To: <20170519063418.7836-2-daniel.santos@pobox.com> (Daniel Santos's message of "Fri, 19 May 2017 01:34:18 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg01522.txt.bz2 Hi Daniel, > Use of .struct in do_test.S causes breakages when gas isn't the > assembler (e.g., Solaris). I also wasn't including TEST_ALWAYS_FLAGS in > my CFLAGS resulting in super-ugly log files. Finally, this patch > eliminates spam of "test unsupported" (limiting it to one printing). > > Signed-off-by: Daniel Santos > --- > .../gcc.target/x86_64/abi/ms-sysv/do-test.S | 26 +++++----------------- > .../gcc.target/x86_64/abi/ms-sysv/ms-sysv.c | 7 ++++++ > .../gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp | 24 ++++++++++++-------- > 3 files changed, 27 insertions(+), 30 deletions(-) > > diff --git a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S > index 1395235fd1e..967eb959fbc 100644 > --- a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S > +++ b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S > @@ -46,22 +46,6 @@ fn: > # define MOVAPS movaps > # endif > > -/* TODO: Is there a cleaner way to provide these offsets? */ > - .struct 0 > -test_data_save: > - > - .struct test_data_save + 224 > -test_data_input: > - > - .struct test_data_save + 448 > -test_data_output: > - > - .struct test_data_save + 672 > -test_data_fn: > - > - .struct test_data_save + 680 > -test_data_retaddr: > - > .text > > regs_to_mem: > @@ -132,23 +116,23 @@ L0: > call regs_to_mem > > # Load register with random data > - lea test_data + test_data_input(%rip), %rax > + lea test_data + 224(%rip), %rax > call mem_to_regs > > # Save original return address > pop %rax > - movq %rax, test_data + test_data_retaddr(%rip) > + movq %rax, test_data + 680(%rip) > > # Call the test function > - call *test_data + test_data_fn(%rip) > + call *test_data + 672(%rip) > > # Restore the original return address > - movq test_data + test_data_retaddr(%rip), %rcx > + movq test_data + 680(%rip), %rcx > push %rcx > > # Save test function return value and store resulting register values > push %rax > - lea test_data + test_data_output(%rip), %rax > + lea test_data + 448(%rip), %rax > call regs_to_mem > > # Restore registers > diff --git a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c > index 2a011f5103d..7cec312c386 100644 > --- a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c > +++ b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c > @@ -346,6 +346,13 @@ int main (int argc, char *argv[]) > assert (!((long)&test_data.regdata[REG_SET_INPUT] & 15)); > assert (!((long)&test_data.regdata[REG_SET_OUTPUT] & 15)); > > + /* Verify offsets hard-coded into assembly. */ > + assert (__builtin_offsetof (struct test_data, regdata[REG_SET_SAVE]) == 0); > + assert (__builtin_offsetof (struct test_data, regdata[REG_SET_INPUT]) == 224); > + assert (__builtin_offsetof (struct test_data, regdata[REG_SET_OUTPUT]) == 448); > + assert (__builtin_offsetof (struct test_data, fn) == 672); > + assert (__builtin_offsetof (struct test_data, retaddr) == 680); > + > while ((c = getopt (argc, argv, "s:f")) != -1) > { > switch (c) while .struct is a gas extension and doesn't work with the Solaris/x86 /bin/as, having the same (mostly unexplained) constants hardcoded in two places isn't exactly helpful. I'd suggest moving them to (say) ms-sysv.h and include that from both do-test.S (which is preprocessed assembler after all) and ms-sysv.c. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University