This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Consider repz; ret as jump for branch mispredict padding
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 10 Jun 2009 22:57:48 +0200
- Subject: Re: [PATCH] Consider repz; ret as jump for branch mispredict padding
- References: <20090610201108.GC4822@tyan-ft48-01.lab.bos.redhat.com>
On 06/10/2009 10:11 PM, Jakub Jelinek wrote:
I've looked today at why test4jmp.sh still shows failures on both x86_64 and
i686 cc1plus binary. The problem is that ix86_pad_returns creates repz; ret
as normal insns instead of jumps ("return" which it replaces is a jump) and
so ix86_avoid_branch_mispredicts considers it as non-jump. Fixed thusly,
fixed all test4jmp.sh reported failures in i686 cc1plus and all but one in
x86_64 cc1plus (the remaining one is in .init section, nothing gcc controls
nor anyone cares, because it is executed just once). .text section in
cc1plus grew by 100-200 bytes.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
2009-06-10 Jakub Jelinek<email@example.com>
* config/i386/i386.c (ix86_pad_returns): Use emit_jump_insn_before
instead of emit_insn_before.
OK for mainline.