This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Consider repz; ret as jump for branch mispredict padding


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<jakub@redhat.com>

* config/i386/i386.c (ix86_pad_returns): Use emit_jump_insn_before
instead of emit_insn_before.

OK for mainline.


Thanks,
Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]