RE: [PATCH] bpf: don't rely on GCC __attribute__((optimize)) to disable GCSE

From: David Laight
Date: Thu Oct 29 2020 - 04:38:50 EST


From: Ard Biesheuvel
> Sent: 27 October 2020 20:57
>
> Commit 3193c0836f203 ("bpf: Disable GCC -fgcse optimization for
> ___bpf_prog_run()") introduced a __no_fgcse macro that expands to a
> function scope __attribute__((optimize("-fno-gcse"))), to disable a
> GCC specific optimization that was causing trouble on x86 builds, and
> was not expected to have any positive effect in the first place.

Surely it is possibly to 'adjust' the bpf code so that gcc doesn't
apply (and can't apply) the gcse optimisation?

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)