branch prediction not correctly applied to an if statement in an inline with multiple conditoins

2024-11-29 Thread Mateusz Guzik via Gcc
Tested with gcc 14.2 and the Linux kernel compiling for amd64. This is at Linux next-20241127. This was already the case on gcc 13 (no idea about earlier versions), I tested 14 to see if the problem is gone. In the particular case I ran into a prediction concerning the return value of __access_ok

Re: feature request: a linker option to avoid merging variables from separate object files into shared cache lines

2024-11-05 Thread Mateusz Guzik via Gcc
On Tue, Nov 5, 2024 at 11:18 AM Florian Weimer wrote: > > * David Brown via Gcc: > > > I would have thought it would be better as part of the compiler. For > > each compilation unit, you generate one or more data sections > > depending on the variable initialisations, compiler options and target

Re: feature request: a linker option to avoid merging variables from separate object files into shared cache lines

2024-10-25 Thread Mateusz Guzik via Gcc
On Thu, Oct 24, 2024 at 4:35 PM Jonathan Wakely wrote: >> For illustrative purposes, I don't care about the name: >> -align-object-data-section=64 >> >> Thoughts? > > > Wouldn't that be a linker option, and so not part of GCC? > Indeed it would be, I assumed this is the right list to prod though.

feature request: a linker option to avoid merging variables from separate object files into shared cache lines

2024-10-25 Thread Mateusz Guzik via Gcc
I understand the stock behavior of pilling variables on may happen to improve cache usage. However, in a multicore setting it is a never-ending source of unintentionally showing up and disappearing false-sharing depending on unrelated variables being added or removed. I'm aware one can manually a

Re: feature request: a linker option to avoid merging variables from separate object files into shared cache lines

2024-10-24 Thread Mateusz Guzik via Gcc
On Thu, Oct 24, 2024 at 5:12 PM Jonathan Wakely wrote: > > > > On Thu, 24 Oct 2024 at 16:06, Mateusz Guzik wrote: >> >> On Thu, Oct 24, 2024 at 4:35 PM Jonathan Wakely >> wrote: >> >> For illustrative purposes, I don't care about the name: >> >> -align-object-data-section=64 >> >> >> >> Thought