public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Andi Kleen <andi@firstfloor.org>
Cc: gcc-patches@gcc.gnu.org, Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH] Add option to force indirect calls for x86
Date: Fri, 10 Nov 2017 14:40:00 -0000	[thread overview]
Message-ID: <ydda7zu43xc.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <20171108143222.4212-1-andi@firstfloor.org> (Andi Kleen's message	of "Wed, 8 Nov 2017 06:32:22 -0800")

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  <ak@linux.intel.com>
>
> 	* 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

  reply	other threads:[~2017-11-10 14:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 15:11 Andi Kleen
2017-11-10 14:40 ` Rainer Orth [this message]
2017-11-08 20:02 Uros Bizjak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ydda7zu43xc.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).