Re: Proposal: Update default build flags to enable frame pointers
On Mon, Nov 18, 2024 at 8:40 AM Richard Biener <rguenther@suse.de> wrote:
On Mon, 18 Nov 2024, Bernhard M. Wiedemann via openSUSE Factory wrote:
On 18/11/2024 09.30, Richard Biener wrote:
I also object to enforce this for x86 32bit which is a very register starved architecture (x86-64 is only slightly better in this regard).
I think, we can leave i586 as is and just improve x86_64. It should have 8 additional general-purpose registers, so losing 1 of 15 is not as bad as losing 1 of 7 on i586.
But I guess, most of the performance impact comes from the 3 extra instructions needed for save+restore of RBP. Is there an option to not use frame-pointers in small functions (where the performance-impact would be the largest) ?
That's -momit-leaf-frame-pointer - small functions are usually leaf (do not call other functions).
The "Shadow Stacks" alternative mentioned in [4] also sounds interesting. CPUs with this seem to be around for 6 years already... But it still needs code to use it.
Not sure about other 64-bit architectures. aarch64, riscv, ppc64 - maybe later?
All those RISCy architectures have enough registers to spare, or like power and s390 have other ways to unwind for backtraces (link register).
In any case - I propose shipping all packages with debug info included since that greatly improves the profiling experience - even more so than by enabling frame-pointers. Bandwidth and disk is cheap these days.
We have debuginfod these days that should allow to pull in required info on demand.
I don't see that doing a whole system profile will pull that in.
And while desktop machines are very powerful these days, running VMs and containers greatly profits from small footprints.
Code without framepointer is smaller as well. Legacy hardware with not "tons of storage" also benefits from a few % more performance more than your up-do-date european HW.
But the storage increase is several orders of magnitude smaller than using DWARF data. -- 真実はいつも一つ!/ Always, there's only one truth!
participants (1)
-
Neal Gompa