public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/100735] New: -fno-trampolines doc wrongly implies it affects C, C++ etc.
@ 2021-05-24  2:22 eggert at gnu dot org
  2021-05-24 10:24 ` [Bug other/100735] " bruno at clisp dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: eggert at gnu dot org @ 2021-05-24  2:22 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/100735] -fno-trampolines doc wrongly implies it affects C, C++ etc.
  2021-05-24  2:22 [Bug other/100735] New: -fno-trampolines doc wrongly implies it affects C, C++ etc eggert at gnu dot org
@ 2021-05-24 10:24 ` bruno at clisp dot org
  2021-05-25  7:34 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bruno at clisp dot org @ 2021-05-24 10:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100735

Bruno Haible <bruno at clisp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bruno at clisp dot org

--- Comment #1 from Bruno Haible <bruno at clisp dot org> ---
(In reply to Paul Eggert from comment #0)
> it is silently ignored for these languages, and I assume for any language
> other than Ada.

Confirmed: flag_trampolines matters only for calls with the ECF_BY_DESCRIPTOR
bit set or CALL_EXPR_BY_DESCRIPTOR being true. Other than from the Ada backend,
such calls are generated only from gimple nodes with subcode bit
GF_CALL_BY_DESCRIPTOR set. GF_CALL_BY_DESCRIPTOR gets set through
gimple_call_set_by_descriptor with argument true, and such calls exist only as
consequence of tree nodes with CALL_EXPR_BY_DESCRIPTOR being true.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/100735] -fno-trampolines doc wrongly implies it affects C, C++ etc.
  2021-05-24  2:22 [Bug other/100735] New: -fno-trampolines doc wrongly implies it affects C, C++ etc eggert at gnu dot org
  2021-05-24 10:24 ` [Bug other/100735] " bruno at clisp dot org
@ 2021-05-25  7:34 ` rguenth at gcc dot gnu.org
  2021-05-25  7:42 ` ebotcazou at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-05-25  7:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100735

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Please post patches to gcc-patches@gcc.gnu.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/100735] -fno-trampolines doc wrongly implies it affects C, C++ etc.
  2021-05-24  2:22 [Bug other/100735] New: -fno-trampolines doc wrongly implies it affects C, C++ etc eggert at gnu dot org
  2021-05-24 10:24 ` [Bug other/100735] " bruno at clisp dot org
  2021-05-25  7:34 ` rguenth at gcc dot gnu.org
@ 2021-05-25  7:42 ` ebotcazou at gcc dot gnu.org
  2021-06-09 16:28 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-05-25  7:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100735

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |ebotcazou at gcc dot gnu.org
   Last reconfirmed|                            |2021-05-25

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> 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.

Patches were posted to make it work in C but didn't make it apparently.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/100735] -fno-trampolines doc wrongly implies it affects C, C++ etc.
  2021-05-24  2:22 [Bug other/100735] New: -fno-trampolines doc wrongly implies it affects C, C++ etc eggert at gnu dot org
                   ` (2 preceding siblings ...)
  2021-05-25  7:42 ` ebotcazou at gcc dot gnu.org
@ 2021-06-09 16:28 ` cvs-commit at gcc dot gnu.org
  2021-06-09 18:15 ` law at gcc dot gnu.org
  2021-06-09 18:58 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-09 16:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100735

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jeff Law <law@gcc.gnu.org>:

https://gcc.gnu.org/g:4a0c4eaea320a418400afc4d63359ed6c4af5548

commit r12-1342-g4a0c4eaea320a418400afc4d63359ed6c4af5548
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Wed Jun 9 12:25:26 2021 -0400

    Document that -fno-trampolines is for Ada only [PR100735]

    gcc/
            PR other/100735
            * doc/invoke.texi (Code Gen Options); Document that
-fno-trampolines
            and -ftrampolines work only with Ada.
            * doc/tm.texi.in (Trampolines): Likewise.
            * doc/tm.texi: Regenerated.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/100735] -fno-trampolines doc wrongly implies it affects C, C++ etc.
  2021-05-24  2:22 [Bug other/100735] New: -fno-trampolines doc wrongly implies it affects C, C++ etc eggert at gnu dot org
                   ` (3 preceding siblings ...)
  2021-06-09 16:28 ` cvs-commit at gcc dot gnu.org
@ 2021-06-09 18:15 ` law at gcc dot gnu.org
  2021-06-09 18:58 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: law at gcc dot gnu.org @ 2021-06-09 18:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100735

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
                 CC|                            |law at gcc dot gnu.org

--- Comment #5 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Fixed with Paul's documentation change on the trunk.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug other/100735] -fno-trampolines doc wrongly implies it affects C, C++ etc.
  2021-05-24  2:22 [Bug other/100735] New: -fno-trampolines doc wrongly implies it affects C, C++ etc eggert at gnu dot org
                   ` (4 preceding siblings ...)
  2021-06-09 18:15 ` law at gcc dot gnu.org
@ 2021-06-09 18:58 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-09 18:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100735

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:

https://gcc.gnu.org/g:8f0d7f322172d411d271aa02024a342c72534465

commit r12-1346-g8f0d7f322172d411d271aa02024a342c72534465
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jun 9 11:56:15 2021 -0700

    Update doc/tm.texi.in to fix commit 4a0c4eaea32

            PR other/100735
            * doc/tm.texi.in (Trampolines): Add a missing blank line.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-06-09 18:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24  2:22 [Bug other/100735] New: -fno-trampolines doc wrongly implies it affects C, C++ etc eggert at gnu dot org
2021-05-24 10:24 ` [Bug other/100735] " bruno at clisp dot org
2021-05-25  7:34 ` rguenth at gcc dot gnu.org
2021-05-25  7:42 ` ebotcazou at gcc dot gnu.org
2021-06-09 16:28 ` cvs-commit at gcc dot gnu.org
2021-06-09 18:15 ` law at gcc dot gnu.org
2021-06-09 18:58 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).