https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88345
--- Comment #19 from Michael Matz <matz at gcc dot gnu.org> --- (In reply to Jan Hubicka from comment #18) > Reading all the discussion again, I am leaning towards -falign-all-functions > + documentation update explaining that -falign-functions/-falign-loops are > optimizations and ignored for -Os. > > I do use -falign-functions/-falign-loops when tuning for new generations of > CPUs and I definitely want to have way to specify alignment that is ignored > for cold functions (as perforance optimization) and we have this behavior > since profile code was introduced in 2002. > > As an optimization, we also want to have hot functions aligned more than 8 > byte boundary needed for patching. > > I will prepare patch for this and send it for disucssion. Pehraps we want > -flive-patching to also imply FUNCTION_BOUNDARY increase on x86-64? Or is > live patching useful if function entries are not aligned? Live patching (user-space) doesn't depend on any particular alignment of functions, on x86-64 at least. (The plan for other architectures wouldn't need any specific alignment either). Note that the above complaints about missing alignment is for kernel (!) ftrace/livepatching on arm64 (!), not on x86_64.