'Retpoline' mitigation technique for Spectre (branch target injection) [CVE-2017-5715]: https://security.googleblog.com/2018/01/more-details-about-mitigations-for-cpu_4.html https://support.google.com/faqs/answer/7625886 https://spectreattack.com/ https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5715 Patch copied from the 'retpoline-regnames' branch of upstream source repository (please keep an eye for new branches or updates for existing branches): http://git.infradead.org/users/dwmw2/gcc-retpoline.git From c26d2b96599ebc9ff24c685a2dc3b01709aa3cce Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sun, 14 Jan 2018 21:27:35 +0000 Subject: [PATCH 09/10] Change %V to bare reg names --- gcc/config/i386/i386.c | 2 +- gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 318a71840c9..6d345031a82 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -18029,7 +18029,7 @@ print_reg (rtx x, int code, FILE *file) warning (0, "unsupported size for integer register"); /* FALLTHRU */ case 4: - if (LEGACY_INT_REGNO_P (regno)) + if (LEGACY_INT_REGNO_P (regno) && code != 'V') putc (msize > 4 && TARGET_64BIT ? 'r' : 'e', file); /* FALLTHRU */ case 2: diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c index f0cd9b75be8..6791890944c 100644 --- a/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c +++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-register-4.c @@ -9,5 +9,5 @@ foo (void) asm("call __x86_indirect_thunk_%V0" : : "a" (func_p)); } -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_eax" { target ia32 } } } */ -/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_rax" { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_ax" { target ia32 } } } */ +/* { dg-final { scan-assembler "call\[ \t\]*__x86_indirect_thunk_ax" { target { ! ia32 } } } } */ -- 2.15.1