https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100735
Bug ID: 100735
Summary: -fno-trampolines doc wrongly implies it affects C, C++
etc.
Product: gcc
Version: 11.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: eggert at gnu dot org
Target Milestone: ---
Created attachment 50859
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50859&action=edit
doc patch for -fno-trampolines confusion
The GCC manual's documentation of -fno-trampolines was apparently written from
an Ada point of view. However, when I read it I understandably mistook it to
say that -fno-trampolines also works for C, C++, etc. It doesn't: it is
silently ignored for these languages, and I assume for any language other than
Ada.
This confusion caused me to go in the wrong direction in a Gnulib dicussion, as
I mistakenly thought that entire C apps with nested functions could be compiled
with -fno-trampolines and then use nested C function in stack overflow handlers
where the alternate stack is allocated via malloc. I was wrong, as this won't
work on common platforms like x86-64 where malloc yields non-executable
storage.
A proposed fix for the GCC manual is attached.