From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66916 invoked by alias); 10 Nov 2017 14:14:37 -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 66835 invoked by uid 89); 10 Nov 2017 14:14:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=timing, cc1, sk:i386-pc, sk:i386pc 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, 10 Nov 2017 14:14:35 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id AE4CD3BB; Fri, 10 Nov 2017 15:14:29 +0100 (CET) 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 c4r5ZymAMDeP; Fri, 10 Nov 2017 15:13:57 +0100 (CET) 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 CA56F353; Fri, 10 Nov 2017 15:13:57 +0100 (CET) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id vAAEDpHo022080; Fri, 10 Nov 2017 15:13:51 +0100 (MET) From: Rainer Orth To: Andi Kleen Cc: gcc-patches@gcc.gnu.org, Andi Kleen Subject: Re: [PATCH] Add option to force indirect calls for x86 References: <20171108143222.4212-1-andi@firstfloor.org> Date: Fri, 10 Nov 2017 14:40:00 -0000 In-Reply-To: <20171108143222.4212-1-andi@firstfloor.org> (Andi Kleen's message of "Wed, 8 Nov 2017 06:32:22 -0800") 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-11/txt/msg00852.txt.bz2 Hi Andi, > This patch adds a -mforce-indirect-call option to force all calls > or tail calls on x86_64 between functions to indirect. This is similar to the > large code model, but doesn't affect jumps inside functions, so has much > less run time overhead. > > This is useful with Intel Processor Trace (PT). PT has precise timing > for indirect calls/jumps, but not for direct ones. So if we can force > them to indirect it allows to time every function relatively accurately > (minus the overhead of the indirect branch) > > Without this short functions often don't see a timing update and cannot > be measured. [...] > gcc/testsuite/: > 2017-11-08 Andi Kleen > > * gcc.target/i386/force-indirect-call-1.c: New test. > * gcc.target/i386/force-indirect-call-2.c: New test. > * gcc.target/i386/force-indirect-call-3.c: New test. two of those new tests FAIL for 32-bit x86 (seen on both i386-pc-solaris2.11 and x86_64-pc-linux-gnu): +FAIL: gcc.target/i386/force-indirect-call-2.c scan-assembler-times call[ \\\\t] +\\\\*% 2 (found 3 times) +FAIL: gcc.target/i386/force-indirect-call-2.c scan-assembler-times jmp[ \\\\t]+ \\\\*% 1 (found 0 times) Also, the test uses -fPIC, thus requires target fpic. +FAIL: gcc.target/i386/force-indirect-call-3.c (test for excess errors) cc1: error: code model 'medium' not supported in the 32 bit mode +UNRESOLVED: gcc.target/i386/force-indirect-call-3.c scan-assembler-times call[ \\\\t]+\\\\*% 2 +UNRESOLVED: gcc.target/i386/force-indirect-call-3.c scan-assembler-times jmp[ \ \\\t]+\\\\*% 1 Please fix. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University