Re: [PATCH] PR 78534, 83704 Large character lengths

2018-01-14 Thread Thomas Koenig
Am 14.01.2018 um 11:45 schrieb Janne Blomqvist: I have tried to use %wp, but it didn’t work: ../../work/gcc/fortran/decl.c: In function 'void gfc_set_constant_character_len(gfc_charlen_t, gfc_expr*, gfc_charlen_t)': ../../work/gcc/fortran/decl.c:1567:5: error: unknown conversion type character

Re: [PATCH 1/5] x86: Add -mindirect-branch=

2018-01-14 Thread Markus Trippelsdorf
On 2018.01.14 at 11:46 +0100, Jan Hubicka wrote: > > gcc/ > > > > * config/i386/i386-opts.h (indirect_branch): New. > > * config/i386/i386-protos.h (ix86_output_indirect_jmp): Likewise. > > * config/i386/i386.c (ix86_using_red_zone): Disallow red-zone > > with local indirect jump

Re: [PATCH] PR 78534, 83704 Large character lengths

2018-01-14 Thread Janne Blomqvist
On Sun, Jan 14, 2018 at 12:45 PM, Janne Blomqvist wrote: > On Sat, Jan 13, 2018 at 7:35 PM, Dominique d'Humières > wrote: >> I have finally bootstrapped gfortran with the two patches applied and the >> spurious warnings with -Wall are now

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Jan Hubicka
> On Sun, Jan 14, 2018 at 11:40 AM, Jan Hubicka wrote: > >> Hi HJ, > >> > >> > -Original Message- > >> > From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches- > >> > ow...@gcc.gnu.org] On Behalf Of H.J. Lu > >> > Sent: Sunday, January 14, 2018 9:07 AM > >> > To:

Re: [PATCH 1/5] x86: Add -mindirect-branch=

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 3:06 AM, Jan Hubicka wrote: >> On 2018.01.14 at 11:46 +0100, Jan Hubicka wrote: >> > > gcc/ >> > > >> > > * config/i386/i386-opts.h (indirect_branch): New. >> > > * config/i386/i386-protos.h (ix86_output_indirect_jmp): Likewise. >> > > *

Re: [PATCH] x86: Disallow -mindirect-branch=/-mfunction-return= with -mshstk

2018-01-14 Thread H.J. Lu
On Sat, Jan 13, 2018 at 8:09 AM, Jeff Law wrote: > On 01/12/2018 09:16 AM, H.J. Lu wrote: >> On Thu, Jan 11, 2018 at 3:00 PM, H.J. Lu wrote: >>> On Thu, Jan 11, 2018 at 2:46 PM, Jeff Law wrote: >> Do you want to mention that CET and

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Uros Bizjak
On Sun, Jan 14, 2018 at 5:41 PM, H.J. Lu wrote: > On Sun, Jan 14, 2018 at 8:39 AM, Uros Bizjak wrote: >> On Sun, Jan 14, 2018 at 5:35 PM, H.J. Lu wrote: >>> On Sun, Jan 14, 2018 at 8:19 AM, Uros Bizjak wrote:

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 6:20 AM, Jan Hubicka wrote: >> > Hi HJ, >> > >> > > -Original Message- >> > > From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches- >> > > ow...@gcc.gnu.org] On Behalf Of H.J. Lu >> > > Sent: Sunday, January 14, 2018 9:07 AM >> > > To:

Re: [PATCH 5/5] x86: Disallow -mindirect-branch=/-mfunction-return= with -mcmodel=large

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 4:57 AM, H.J. Lu wrote: > On Sun, Jan 14, 2018 at 2:47 AM, Jan Hubicka wrote: >>> Since the thunk function may not be reachable in large code model, >>> -mcmodel=large is incompatible with -mindirect-branch=thunk, >>>

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Uros Bizjak
On Fri, Jan 12, 2018 at 9:01 AM, Uros Bizjak wrote: > On Thu, Jan 11, 2018 at 2:28 PM, H.J. Lu wrote: > >> Hi Uros, >> >> Can you take a look at my x86 backend changes so that they are ready >> to check in once we have consensus. > > Please finish the

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Jakub Jelinek
On Sun, Jan 14, 2018 at 08:41:54AM -0800, H.J. Lu wrote: > They are used in asm statements in kernel: > > extern void (*func_p) (void); > > void > foo (void) > { > asm ("call __x86_indirect_thunk_%V0" : : "a" (func_p)); Well, using it just with a single register classes wouldn't make much

Re: inline_small_functions speedup

2018-01-14 Thread Jan Hubicka
> After inlining A into B, inline_small_functions updates the information > for (most) callees and callers of the new B: > > update_callee_keys (_heap, where, updated_nodes); > [...] > /* Our profitability metric can depend on local properties >such as number of

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Uros Bizjak
On Sun, Jan 14, 2018 at 5:35 PM, H.J. Lu wrote: > On Sun, Jan 14, 2018 at 8:19 AM, Uros Bizjak wrote: >> On Fri, Jan 12, 2018 at 9:01 AM, Uros Bizjak wrote: >>> On Thu, Jan 11, 2018 at 2:28 PM, H.J. Lu wrote: >>>

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 8:45 AM, Jakub Jelinek wrote: > On Sun, Jan 14, 2018 at 08:41:54AM -0800, H.J. Lu wrote: >> They are used in asm statements in kernel: >> >> extern void (*func_p) (void); >> >> void >> foo (void) >> { >> asm ("call __x86_indirect_thunk_%V0" : : "a"

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 8:48 AM, Uros Bizjak wrote: > On Sun, Jan 14, 2018 at 5:41 PM, H.J. Lu wrote: >> On Sun, Jan 14, 2018 at 8:39 AM, Uros Bizjak wrote: >>> On Sun, Jan 14, 2018 at 5:35 PM, H.J. Lu wrote:

Re: [PATCH 2/5] x86: Add -mfunction-return=

2018-01-14 Thread Jan Hubicka
> Add -mfunction-return= option to convert function return to call and > return thunks. The default is 'keep', which keeps function return > unmodified. 'thunk' converts function return to call and return thunk. > 'thunk-inline' converts function return to inlined call and return thunk. >

Do not ICE on roundoff errors in ipa-inline

2018-01-14 Thread Jan Hubicka
Hi, this patch fixes ICE on the testcase where we estimate function body to be rather slow and get roundoff error out of sreal. Honza PR ipa/83051 * gcc.c-torture/compile/pr83051.c: New testcase. * ipa-inline.c (edge_badness): Tolerate roundoff errors. Index:

Re: [PATCH 5/5] x86: Disallow -mindirect-branch=/-mfunction-return= with -mcmodel=large

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 2:47 AM, Jan Hubicka wrote: >> Since the thunk function may not be reachable in large code model, >> -mcmodel=large is incompatible with -mindirect-branch=thunk, >> -mindirect-branch=thunk-extern, -mfunction-return=thunk and >>

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Jan Hubicka
> > Hi HJ, > > > > > -Original Message- > > > From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches- > > > ow...@gcc.gnu.org] On Behalf Of H.J. Lu > > > Sent: Sunday, January 14, 2018 9:07 AM > > > To: gcc-patches@gcc.gnu.org > > > Subject: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre >

Re: [PATCH 1/5] x86: Add -mindirect-branch=

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 4:52 AM, H.J. Lu wrote: > On Sun, Jan 14, 2018 at 3:06 AM, Jan Hubicka wrote: >>> On 2018.01.14 at 11:46 +0100, Jan Hubicka wrote: >>> > > gcc/ >>> > > >>> > > * config/i386/i386-opts.h (indirect_branch): New. >>> > > *

Re: [PATCH 0/5] Make std::future::wait_* use std::chrono::steady_clock when required

2018-01-14 Thread Mike Crowe
Hi Torvald, Thanks for reviewing this change. On Saturday 13 January 2018 at 16:29:57 +0100, Torvald Riegel wrote: > On Sun, 2018-01-07 at 20:55 +, Mike Crowe wrote: > > This is a first attempt to make std::future::wait_until and > > std::future::wait_for make correct use of > >

[committed] Small i?86/x86_64-linux config.gcc extra_headers fixes

2018-01-14 Thread Jakub Jelinek
Hi! I've noticed that i?86-*-* has 2 gfniintrin.h entries in extra_headers and x86_64-*-* even 3, one should be enough. Fixed thusly, committed to trunk as obvious. 2018-01-14 Jakub Jelinek * config.gcc (i[34567]86-*-*): Remove one duplicate gfniintrin.h

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 8:39 AM, Uros Bizjak wrote: > On Sun, Jan 14, 2018 at 5:35 PM, H.J. Lu wrote: >> On Sun, Jan 14, 2018 at 8:19 AM, Uros Bizjak wrote: >>> On Fri, Jan 12, 2018 at 9:01 AM, Uros Bizjak wrote:

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Jan Hubicka
> Hi HJ, > > > -Original Message- > > From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches- > > ow...@gcc.gnu.org] On Behalf Of H.J. Lu > > Sent: Sunday, January 14, 2018 9:07 AM > > To: gcc-patches@gcc.gnu.org > > Subject: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre > > > > This set

Re: [PATCH 3/5] x86: Add -mindirect-branch-register

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 2:46 AM, Jan Hubicka wrote: >> Add -mindirect-branch-register to force indirect branch via register. >> This is implemented by disabling patterns of indirect branch via memory, >> similar to TARGET_X32. >> >> -mindirect-branch= and -mfunction-return= tests

Re: [PATCH 4/5] x86: Add 'V' register operand modifier

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 2:47 AM, Jan Hubicka wrote: >> Add 'V', a special modifier which prints the name of the full integer >> register without '%'. For >> >> extern void (*func_p) (void); >> >> void >> foo (void) >> { >> asm ("call __x86_indirect_thunk_%V0" : : "a" (func_p));

Re: [PATCH 2/5] x86: Add -mfunction-return=

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 4:54 AM, H.J. Lu wrote: > On Sun, Jan 14, 2018 at 3:31 AM, H.J. Lu wrote: >> On Sun, Jan 14, 2018 at 2:48 AM, Jan Hubicka wrote: Add -mfunction-return= option to convert function return to call and

inline_small_functions speedup

2018-01-14 Thread Richard Sandiford
After inlining A into B, inline_small_functions updates the information for (most) callees and callers of the new B: update_callee_keys (_heap, where, updated_nodes); [...] /* Our profitability metric can depend on local properties such as number of inlinable calls

RE: [PATCH 2/5] x86: Add -mindirect-branch-loop=

2018-01-14 Thread Kumar, Venkataramanan
Hi Arjan, > -Original Message- > From: Van De Ven, Arjan [mailto:arjan.van.de@intel.com] > Sent: Saturday, January 13, 2018 10:16 PM > To: David Woodhouse ; Kumar, Venkataramanan > ; H.J. Lu ; Jeff > Law

Re: PR81703 and Martin's fix for PR83501

2018-01-14 Thread Prathamesh Kulkarni
On 12 January 2018 at 23:25, Jakub Jelinek wrote: > On Fri, Jan 12, 2018 at 10:38:39AM -0700, Jeff Law wrote: >> >>> Thanks for pointing it out. I see it there as well with >> >>> Prathamesh's test case, though not with the test case in >> >>> bug 83543. It is the same root

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 8:19 AM, Uros Bizjak wrote: > On Fri, Jan 12, 2018 at 9:01 AM, Uros Bizjak wrote: >> On Thu, Jan 11, 2018 at 2:28 PM, H.J. Lu wrote: >> >>> Hi Uros, >>> >>> Can you take a look at my x86 backend changes so that

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Uros Bizjak
On Sun, Jan 14, 2018 at 5:35 PM, H.J. Lu wrote: > On Sun, Jan 14, 2018 at 8:19 AM, Uros Bizjak wrote: >> On Fri, Jan 12, 2018 at 9:01 AM, Uros Bizjak wrote: >>> On Thu, Jan 11, 2018 at 2:28 PM, H.J. Lu wrote: >>>

Re: [PATCH] PR 78534, 83704 Large character lengths

2018-01-14 Thread Janne Blomqvist
On Sat, Jan 13, 2018 at 7:35 PM, Dominique d'Humières wrote: > I have finally bootstrapped gfortran with the two patches applied and the > spurious warnings with -Wall are now gone (limited testing), but I see a > regression for gfortran.dg/string_1.f90 due to an

Re: [PATCH 2/5] x86: Add -mfunction-return=

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 3:31 AM, H.J. Lu wrote: > On Sun, Jan 14, 2018 at 2:48 AM, Jan Hubicka wrote: >>> Add -mfunction-return= option to convert function return to call and >>> return thunks. The default is 'keep', which keeps function return >>>

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 4:42 AM, Jan Hubicka wrote: >> On Sun, Jan 14, 2018 at 11:40 AM, Jan Hubicka wrote: >> >> Hi HJ, >> >> >> >> > -Original Message- >> >> > From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches- >> >> > ow...@gcc.gnu.org] On Behalf

[PATCH] C/C++: Add -Waddress-of-packed-member

2018-01-14 Thread H.J. Lu
When address of packed member of struct or union is taken, it may result in an unaligned pointer value. This patch adds -Waddress-of-packed-member to warn it: $ cat x.i struct pair_t { char c; int i; } __attribute__ ((packed)); extern struct pair_t p; int *addr = $ gcc -O2 -S x.i x.i:8:13:

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread H.J. Lu
Now my patch set has been checked into trunk. Here is a patch set to move struct ix86_frame to machine_function on GCC 7, which is needed to backport the patch set to GCC 7: https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01239.html https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01240.html

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 1:58 PM, David Woodhouse wrote: > On Sun, 2018-01-14 at 13:07 -0800, Linus Torvalds wrote: >> On Sun, Jan 14, 2018 at 1:02 PM, David Woodhouse wrote: >> > >> > Review on the GCC patches has led to a request that the thunk symbols

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread David Woodhouse
On Sun, 2018-01-14 at 14:03 -0800, H.J. Lu wrote: > > > And *that* was the point at which I asked HJ to just use the proper > > bloody register names :) > > Please let me know if I should make the change to ax,..., r8,..r15. This is what I'm building my compiler with now, to make that change:

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread David Woodhouse
On Sun, 2018-01-14 at 15:02 -0800, Linus Torvalds wrote: > On Sun, Jan 14, 2018 at 2:39 PM, David Woodhouse > wrote: > > > > I'm not convinced we want to do this, but I'll defer to Linus. > > Well, I guess we have no choice, if gcc ends up using the stupid > names. At this

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Linus Torvalds
On Sun, Jan 14, 2018 at 3:09 PM, David Woodhouse wrote: > > I think we should stick with what we have now, with the names of the > thunks actually being the *full* name of the register (rax, eax, etc.) > that they use. It that works for the gcc people, then yes, I agree. The

[PATCH] x86/retpoline: Switch thunk names to match final GCC patches

2018-01-14 Thread David Woodhouse
At the last minute, they were switched from __x86_indirect_thunk_rax to __x86_indirect_thunk_ax without the 'r' or 'e' on the register name. Except for the _r[89..] versions, obviously. This is not entirely an improvement, IMO. Reluctantly-signed-off-by: David Woodhouse --- I

Re: [PATCH][RFC] Radically simplify emission of balanced tree for switch statements.

2018-01-14 Thread Bernhard Reutner-Fischer
On 10 January 2018 15:59:28 CET, "Martin Liška" wrote: >On 01/10/2018 02:13 PM, Richard Biener wrote: >> On Tue, Jan 9, 2018 at 7:29 PM, Jeff Law wrote: >>> On 01/09/2018 07:43 AM, Martin Liška wrote: On 09/20/2017 05:00 PM, Jeff Law wrote: > On

Re: [PATCH 2/5] x86: Add -mfunction-return=

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 2:48 AM, Jan Hubicka wrote: >> Add -mfunction-return= option to convert function return to call and >> return thunks. The default is 'keep', which keeps function return >> unmodified. 'thunk' converts function return to call and return thunk. >>

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Uros Bizjak
On Sun, Jan 14, 2018 at 11:40 AM, Jan Hubicka wrote: >> Hi HJ, >> >> > -Original Message- >> > From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches- >> > ow...@gcc.gnu.org] On Behalf Of H.J. Lu >> > Sent: Sunday, January 14, 2018 9:07 AM >> > To: gcc-patches@gcc.gnu.org

[PATCH 2/3] GCC 7: i386: Use reference of struct ix86_frame to avoid copy

2018-01-14 Thread H.J. Lu
From: hjl When there is no need to make a copy of ix86_frame, we can use reference of struct ix86_frame to avoid copy. Tested on x86-64. Backport from mainline * config/i386/i386.c (ix86_can_use_return_insn_p): Use reference of

Re: [patch, committed] PR83811 fortran 'e' format broken for single digit exponents

2018-01-14 Thread Jerry DeLisle
On 01/14/2018 09:42 AM, Jerry DeLisle wrote: > Hello all, > > I committed the following as trivial. > > Regression tested on x86_64-pc-linux-gnu. > > This is a regression on 7 so I will backport. > > Regards, > > Jerry > > 2018-01-18 Jerry DeLisle > > PR

Re: [PATCH] document -Wclass-memaccess suppression by casting (PR 81327)

2018-01-14 Thread Martin Sebor
On 01/14/2018 03:31 AM, Jakub Jelinek wrote: On Sat, Jan 13, 2018 at 04:14:38PM -0700, Martin Sebor wrote: -The @option{-Wclass-memaccess} option is enabled by @option{-Wall}. +The @option{-Wclass-memaccess} option is enabled by @option{-Wall}. Casting Perhaps "Explicitly casting" instead?

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread David Woodhouse
On Sun, 2018-01-14 at 13:07 -0800, Linus Torvalds wrote: > On Sun, Jan 14, 2018 at 1:02 PM, David Woodhouse wrote: > > > > Review on the GCC patches has led to a request that the thunk symbols > > be changed from e.g. __x86_indirect_thunk_rax to > > __x86_indirect_thunk_ax

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 2:09 PM, David Woodhouse wrote: > On Sun, 2018-01-14 at 14:03 -0800, H.J. Lu wrote: >> >> > And *that* was the point at which I asked HJ to just use the proper >> > bloody register names :) >> >> Please let me know if I should make the change to

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Linus Torvalds
On Sun, Jan 14, 2018 at 2:39 PM, David Woodhouse wrote: > > I'm not convinced we want to do this, but I'll defer to Linus. Well, I guess we have no choice, if gcc ends up using the stupid names. And yes, apparently this just made our macros worse instead of cleaning

Re: [PATCH] x86/retpoline: Switch thunk names to match final GCC patches

2018-01-14 Thread Linus Torvalds
On Sun, Jan 14, 2018 at 3:23 PM, David Woodhouse wrote: > I think we *shouldn't* do this. Uros said we could look at it and make > a decision, and GCC would implement what we decide. Up to Linus. Regardless of whether we end up having to do this, I'm not doing rc8 with it, and

[PATCH] handle multiple flexible array members (PR 83588)

2018-01-14 Thread Martin Sebor
The attached patch fixes PR c++/83588 - struct with two flexible arrays causes an internal compiler error. The ICE is caused by the same assertion in varasm.c that has led to other similar reports in the past: /* Given a non-empty initialization, this field had better be last. Given a

Re: [RFC][PATCH] PR preprocessor/83173: Additional check before decrementing highest_location

2018-01-14 Thread Mike Gulick
On 01/12/2018 06:16 PM, David Malcolm wrote: > On Fri, 2017-12-01 at 17:57 -0500, Mike Gulick wrote: >> I've come up with some patches that fix PR preprocessor/83173, which >> I reported >> a couple of weeks ago. >> >> The first patch is a test case. The second and third patches are two >>

Re: [PATCH 3/5] x86: Add -mindirect-branch-register

2018-01-14 Thread Uros Bizjak
- (ior (and (not (match_test "TARGET_X32")) + (ior (and (not (match_test "TARGET_X32 + || ix86_indirect_branch_thunk_register")) (match_operand 0 "sibcall_memory_operand")) - (and (match_test "TARGET_X32 && Pmode == DImode") + (and (match_test "TARGET_X32 && Pmode == DImode

Re: [PATCH 3/5] x86: Add -mindirect-branch-register

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 9:51 AM, Uros Bizjak wrote: > - (ior (and (not (match_test "TARGET_X32")) > + (ior (and (not (match_test "TARGET_X32 > + || ix86_indirect_branch_thunk_register")) > (match_operand 0 "sibcall_memory_operand")) > - (and (match_test

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread David Woodhouse
On Sun, 2018-01-14 at 21:21 +0100, Uros Bizjak wrote: > A quick look through latest x86/pti update [1] shows: > > +#ifdef CONFIG_X86_32 > +#define INDIRECT_THUNK(reg) extern asmlinkage void > __x86_indirect_thunk_e ## reg(void); > +#else > +#define INDIRECT_THUNK(reg) extern asmlinkage void >

Re: [PATCH 3/5] x86: Add -mindirect-branch-register

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 10:52 AM, Uros Bizjak wrote: > On Sun, Jan 14, 2018 at 7:08 PM, H.J. Lu wrote: >> On Sun, Jan 14, 2018 at 9:51 AM, Uros Bizjak wrote: >>> - (ior (and (not (match_test "TARGET_X32")) >>> + (ior (and (not

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Thomas Gleixner
On Sun, 14 Jan 2018, David Woodhouse wrote: > On Sun, 2018-01-14 at 13:07 -0800, Linus Torvalds wrote: > > On Sun, Jan 14, 2018 at 1:02 PM, David Woodhouse > > wrote: > > > Review on the GCC patches has led to a request that the thunk symbols > > > be changed from e.g.

Re: [PATCH 1/5] x86: Add -mindirect-branch=

2018-01-14 Thread David Woodhouse
On Sun, 2018-01-14 at 12:06 +0100, Jan Hubicka wrote: > > Yes, according to my understanding we want both pause and lefence by default > (it is expensive anyway) + command line option to control which one to use? > > Probably thus the first patch should default to both. In the kernel we're

Re: [PATCH 0/5] Make std::future::wait_* use std::chrono::steady_clock when required

2018-01-14 Thread Mike Crowe
On Sunday 14 January 2018 at 16:08:09 +, Mike Crowe wrote: > Hi Torvald, > > Thanks for reviewing this change. > > On Saturday 13 January 2018 at 16:29:57 +0100, Torvald Riegel wrote: > > On Sun, 2018-01-07 at 20:55 +, Mike Crowe wrote: > > > This is a first attempt to make

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Woodhouse, David
This won't make the list; I'll send a more coherent and less HTML-afflicted version later. The bare 'ax' naming made it painful to instantiate the external thunks for 32-bit and 64-bot code because we had to put the e/r back again inside the .irp reg ax bx... code. We could probably have

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Uros Bizjak
On Sun, Jan 14, 2018 at 9:34 PM, David Woodhouse wrote: > Likewise, the CONFIG_TRIM_UNUSED_SYMBOLS mechanism in the kernel passes > .S files through the preprocessor and looks for EXPORT_SYMBOL, so it > wasn't working well with my .irp-based implementation like the one in >

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread David Woodhouse
On Sun, 2018-01-14 at 21:52 +0100, Uros Bizjak wrote: > On Sun, Jan 14, 2018 at 9:34 PM, David Woodhouse wrote: > > But sure, right now it isn't that might of a difference for me; my > > implementation has changed since I made that reqeust. I have no > > fundamental technical

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread David Woodhouse
On Sun, 2018-01-14 at 13:07 -0800, Linus Torvalds wrote: > On Sun, Jan 14, 2018 at 1:02 PM, David Woodhouse wrote: > > Review on the GCC patches has led to a request that the thunk symbols > > be changed from e.g. __x86_indirect_thunk_rax to > > __x86_indirect_thunk_ax

Re: [PATCH 3/5] x86: Add -mindirect-branch-register

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 10:52 AM, Uros Bizjak wrote: > On Sun, Jan 14, 2018 at 7:08 PM, H.J. Lu wrote: >> On Sun, Jan 14, 2018 at 9:51 AM, Uros Bizjak wrote: >>> - (ior (and (not (match_test "TARGET_X32")) >>> + (ior (and (not

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 1:07 PM, Linus Torvalds wrote: > On Sun, Jan 14, 2018 at 1:02 PM, David Woodhouse wrote: >> Review on the GCC patches has led to a request that the thunk symbols >> be changed from e.g. __x86_indirect_thunk_rax to >>

[PATCH, rs6000] Executable tests for -msafe-indirect-jumps

2018-01-14 Thread Bill Schmidt
Hi, It was pointed out off-list that I should add some executable tests for the new -msafe-indirect-jumps implementation. This patch adds three such tests to demonstrate correct behavior. Tested on powerpc64-linux-gnu and powerpc64le-linux-gnu. Are these tests okay for trunk after the other

[patch, committed] PR83811 fortran 'e' format broken for single digit exponents

2018-01-14 Thread Jerry DeLisle
Hello all, I committed the following as trivial. Regression tested on x86_64-pc-linux-gnu. This is a regression on 7 so I will backport. Regards, Jerry 2018-01-18 Jerry DeLisle PR libgfortran/83811 * write.c (select_buffer): Adjust buffer size up by

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Uros Bizjak
On Sun, Jan 14, 2018 at 7:22 PM, Uros Bizjak wrote: > On Sun, Jan 14, 2018 at 6:44 PM, Woodhouse, David wrote: >> This won't make the list; I'll send a more coherent and less HTML-afflicted >> version later. >> >> The bare 'ax' naming made it painful to

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Linus Torvalds
On Sun, Jan 14, 2018 at 1:02 PM, David Woodhouse wrote: > Review on the GCC patches has led to a request that the thunk symbols > be changed from e.g. __x86_indirect_thunk_rax to > __x86_indirect_thunk_ax without the 'r'. Ok. I think that just makes it easier for us, since

ia64: Update libstdc++ baseline_symbols.txt

2018-01-14 Thread Andreas Schwab
Installed as obvious. Andreas. PR libstdc++/81092 * config/abi/post/ia64-linux-gnu/baseline_symbols.txt: Update. diff --git a/libstdc++-v3/config/abi/post/ia64-linux-gnu/baseline_symbols.txt b/libstdc++-v3/config/abi/post/ia64-linux-gnu/baseline_symbols.txt index

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Uros Bizjak
On Sun, Jan 14, 2018 at 6:44 PM, Woodhouse, David wrote: > This won't make the list; I'll send a more coherent and less HTML-afflicted > version later. > > The bare 'ax' naming made it painful to instantiate the external thunks for > 32-bit and 64-bot code because we had to put

Re: [PATCH 3/5] x86: Add -mindirect-branch-register

2018-01-14 Thread Uros Bizjak
On Sun, Jan 14, 2018 at 7:08 PM, H.J. Lu wrote: > On Sun, Jan 14, 2018 at 9:51 AM, Uros Bizjak wrote: >> - (ior (and (not (match_test "TARGET_X32")) >> + (ior (and (not (match_test "TARGET_X32 >> + || ix86_indirect_branch_thunk_register")) >>

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread David Woodhouse
On Sun, 2018-01-14 at 14:12 -0800, H.J. Lu wrote: > Please use this GCC patch instead. Building now; thanks. This is the kernel patch I'll test as soon as the compiler is done. It's slightly less horrid than the "clever" one I sent out earlier, but does still end up needing those _ASM_AX etc.

RE: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread Kumar, Venkataramanan
Hi > -Original Message- > From: H.J. Lu [mailto:hjl.to...@gmail.com] > Sent: Sunday, January 14, 2018 7:52 PM > To: Jan Hubicka > Cc: Kumar, Venkataramanan ; gcc- > patc...@gcc.gnu.org; Dharmakan, Rohit arul raj >

Re: [PATCH] suppress -Wstringop-overflow when no-warning is set (PR 83508)

2018-01-14 Thread Jeff Law
On 01/11/2018 04:49 PM, Martin Sebor wrote: > On 01/11/2018 04:24 PM, Jeff Law wrote: >> On 01/10/2018 01:26 PM, Martin Sebor wrote: >>> To avoid issuing duplicate warnings for the same function call >>> in the source code the -Wrestrict warning code makes sure >>> the no-warning bit is propagated

Re: [PATCH 3/5] x86: Add -mindirect-branch-register

2018-01-14 Thread H.J. Lu
On Sun, Jan 14, 2018 at 1:23 PM, H.J. Lu wrote: > On Sun, Jan 14, 2018 at 10:52 AM, Uros Bizjak wrote: >> On Sun, Jan 14, 2018 at 7:08 PM, H.J. Lu wrote: >>> On Sun, Jan 14, 2018 at 9:51 AM, Uros Bizjak wrote:

Re: [PATCH 1/2] Fix unstable sort

2018-01-14 Thread Jeff Law
On 01/12/2018 01:58 PM, li...@coryfields.com wrote: > From: Cory Fields > > 2018-01-12 Cory Fields >* tree-ssa-loop-im.c (sort_bbs_in_loop_postorder_cmp): stabilize sort Thanks. Installed onto the trunk. jeff

Re: [PATCH] MicroBlaze resolve section change issues for ident output

2018-01-14 Thread Jeff Law
On 01/11/2018 06:54 AM, Nathan Rossi wrote: > 2018-01-11 Nathan Rossi > > PR target/83013 > * config/microblaze/microblaze.c (microblaze_asm_output_ident): > Use .pushsection/.popsection THanks. Installed on the trunk. jeff

Re: [PATCH 2/2] Fix unstable sort

2018-01-14 Thread Jeff Law
On 01/12/2018 01:58 PM, li...@coryfields.com wrote: > From: Cory Fields > > 2018-01-12 Cory Fields >* tree-ira.c (allocno_hard_regs_compare): stabilize sort Thanks. I fixed the ChangeLog entry and installed hte patch on the

Re: [PATCH] Add new verification for profile-count.h.

2018-01-14 Thread Tom de Vries
On 01/12/2018 09:44 AM, Jan Hubicka wrote: Hi. Following patch adds new sanitization checks for profile_quality. Problem is that zero initialization of a struct with profile_count will lead to an invalid counter. This can help to catch them. Patch can bootstrap on ppc64le-redhat-linux and

Re: [PATCH] document -Wclass-memaccess suppression by casting (PR 81327)

2018-01-14 Thread Jakub Jelinek
On Sat, Jan 13, 2018 at 04:14:38PM -0700, Martin Sebor wrote: > -The @option{-Wclass-memaccess} option is enabled by @option{-Wall}. > +The @option{-Wclass-memaccess} option is enabled by @option{-Wall}. Casting Perhaps "Explicitly casting" instead? The implicit cast doesn't suppress it and

Re: [PATCH 5/5] x86: Disallow -mindirect-branch=/-mfunction-return= with -mcmodel=large

2018-01-14 Thread Jan Hubicka
> Since the thunk function may not be reachable in large code model, > -mcmodel=large is incompatible with -mindirect-branch=thunk, > -mindirect-branch=thunk-extern, -mfunction-return=thunk and > -mfunction-return=thunk-extern. Issue an error when they are used with > -mcmodel=large. > > gcc/ >

Re: [PATCH 4/5] x86: Add 'V' register operand modifier

2018-01-14 Thread Jan Hubicka
> Add 'V', a special modifier which prints the name of the full integer > register without '%'. For > > extern void (*func_p) (void); > > void > foo (void) > { > asm ("call __x86_indirect_thunk_%V0" : : "a" (func_p)); > } > > it generates: > > foo: > movqfunc_p(%rip), %rax >

Re: [PATCH 3/5] x86: Add -mindirect-branch-register

2018-01-14 Thread Jan Hubicka
> Add -mindirect-branch-register to force indirect branch via register. > This is implemented by disabling patterns of indirect branch via memory, > similar to TARGET_X32. > > -mindirect-branch= and -mfunction-return= tests are updated with > -mno-indirect-branch-register to avoid false test

Re: [PATCH 1/5] x86: Add -mindirect-branch=

2018-01-14 Thread Jan Hubicka
> gcc/ > > * config/i386/i386-opts.h (indirect_branch): New. > * config/i386/i386-protos.h (ix86_output_indirect_jmp): Likewise. > * config/i386/i386.c (ix86_using_red_zone): Disallow red-zone > with local indirect jump when converting indirect call and jump. >

[patch, fortran] Change ABI for F2008 - minloc/maxloc BACK argument

2018-01-14 Thread Thomas Koenig
Hello world, here is the latest take on the min/maxloc ABI change for BACK. This version now passes BACK as a GFC_LOGCIAL_4 by value in all cases. I did this by using the existing %VAL mechanism. I also added another test case which crashed during one stage of development. So, OK for trunk?

Re: [PATCH 1/5] x86: Add -mindirect-branch=

2018-01-14 Thread Jan Hubicka
> On 2018.01.14 at 11:46 +0100, Jan Hubicka wrote: > > > gcc/ > > > > > > * config/i386/i386-opts.h (indirect_branch): New. > > > * config/i386/i386-protos.h (ix86_output_indirect_jmp): Likewise. > > > * config/i386/i386.c (ix86_using_red_zone): Disallow red-zone > > > with local indirect

[PATCH 1/3] GCC 7: i386: Move struct ix86_frame to machine_function

2018-01-14 Thread H.J. Lu
Make ix86_frame available to i386 code generation. This is needed to backport the patch set of -mindirect-branch= to mitigate variant #2 of the speculative execution vulnerabilities on x86 processors identified by CVE-2017-5715, aka Spectre. Backport from mainline *

[PATCH 3/3] GCC 7: i386: More use reference of struct ix86_frame to avoid copy

2018-01-14 Thread H.J. Lu
When there is no need to make a copy of ix86_frame, we can use reference of struct ix86_frame to avoid copy. Backport from mainline * config/i386/i386.c (ix86_expand_prologue): Use reference of struct ix86_frame. (ix86_expand_epilogue): Likewise. ---

[PATCH 0/3] GCC 7: i386: Move struct ix86_frame to machine_function

2018-01-14 Thread H.J. Lu
This patch set makes ix86_frame available to i386 code generation. They are needed to backport the patch set of -mindirect-branch= to mitigate variant #2 of the speculative execution vulnerabilities on x86 processors identified by CVE-2017-5715, aka Spectre. H.J. Lu (2): i386: Move struct

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-14 Thread David Woodhouse
On Sun, 2018-01-14 at 21:52 +0100, Uros Bizjak wrote: > > Well, you did say that these are strange times ;) > > From the user perspective, it would be more convenient to use the > thunk names that are the same for 32bit and 64bit targets. If we > ignore this fact, the difference is only a couple