public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/29231] need a way to produce trampolines not on the stack
       [not found] <bug-29231-4@http.gcc.gnu.org/bugzilla/>
@ 2021-11-28  0:02 ` pinskia at gcc dot gnu.org
  2024-04-03 23:24 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-28  0:02 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-11-28

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
.

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

* [Bug middle-end/29231] need a way to produce trampolines not on the stack
       [not found] <bug-29231-4@http.gcc.gnu.org/bugzilla/>
  2021-11-28  0:02 ` [Bug middle-end/29231] need a way to produce trampolines not on the stack pinskia at gcc dot gnu.org
@ 2024-04-03 23:24 ` pinskia at gcc dot gnu.org
  2024-04-04  8:25 ` iains at gcc dot gnu.org
  2024-04-04 10:36 ` iains at gcc dot gnu.org
  3 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-03 23:24 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iains at gcc dot gnu.org

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Most of the support was added in r14-4821-g28d8c680aaea46 .

Maybe Iain can provide more information on what else is needed to be done if
anything.

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

* [Bug middle-end/29231] need a way to produce trampolines not on the stack
       [not found] <bug-29231-4@http.gcc.gnu.org/bugzilla/>
  2021-11-28  0:02 ` [Bug middle-end/29231] need a way to produce trampolines not on the stack pinskia at gcc dot gnu.org
  2024-04-03 23:24 ` pinskia at gcc dot gnu.org
@ 2024-04-04  8:25 ` iains at gcc dot gnu.org
  2024-04-04 10:36 ` iains at gcc dot gnu.org
  3 siblings, 0 replies; 8+ messages in thread
From: iains at gcc dot gnu.org @ 2024-04-04  8:25 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=113401

--- Comment #7 from Iain Sandoe <iains at gcc dot gnu.org> ---
Current status.

We have implemented (currently for hosted x86 and aarch64) a heap-based
trampoline approach.

for efficiency heap trampolines are allocated in tables of one page in size (no
pages are allocated until the first trampoline requires one).  Pages are added
and subtracted as the number of trampoline tables increases/decreases.  One
proviso - the first allocated page is sticky (this avoids mmap/etc. churn if
there are a lot of single trampolines required).  Trampoline pages are per
thread.

The mechanism works with platforms that will not allow heap pages to be both
writable and executable at the same time (the page is made temporarily r+w to
make changes and then r+x for operation).  For Darwin, there's a permission
mode "jit" that does something similar.

A new platform needs to supply the libgcc support for example : 

libgcc/config/aarch64/heap-trampoline.c
libgcc/config/aarch64/t-heap-trampoline + a reference to this in
libgcc/config.host

A new platform can elect to default to heap trampolines by adding
HEAP_TRAMPOLINES_INIT=1 to tm_defines in the relevant target section in
gcc/config.gcc

There is currently (pre gcc-14 branch) one unhandled issue which is
reallocation of the last "sticky" trampoline page when a thread exits.

I would say, that (within realistic implementation constraints) we could count
this as fixed.

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

* [Bug middle-end/29231] need a way to produce trampolines not on the stack
       [not found] <bug-29231-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2024-04-04  8:25 ` iains at gcc dot gnu.org
@ 2024-04-04 10:36 ` iains at gcc dot gnu.org
  3 siblings, 0 replies; 8+ messages in thread
From: iains at gcc dot gnu.org @ 2024-04-04 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Iain Sandoe <iains at gcc dot gnu.org> ---
A secondary comment - the wiring up of the built-ins that allocate/deallocate
trampoline entries makes the underlying mechanism opaque to the middle end
consumer.

So, although the current example implementations use mmap / heap, I do not
believe that there is anything preventing an implementation from choosing some
alternate scheme for allocation of tables (e.g. a non-hosted impl could use a
fixed allocation - presumably with a hard fail if that allocation is exceeded.)

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

* [Bug middle-end/29231] need a way to produce trampolines not on the stack
  2006-09-25 23:21 [Bug target/29231] New: powerpc libgcc writes code to " debian-gcc at lists dot debian dot org
                   ` (2 preceding siblings ...)
  2006-09-26  4:06 ` acahalan at gmail dot com
@ 2009-01-01 21:25 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-01 21:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2009-01-01 21:22 -------
This is why the PowerOpen ABI is good, it does not require stack based
trampolines.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|patch                       |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29231


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

* [Bug middle-end/29231] need a way to produce trampolines not on the stack
  2006-09-25 23:21 [Bug target/29231] New: powerpc libgcc writes code to " debian-gcc at lists dot debian dot org
  2006-09-25 23:53 ` [Bug middle-end/29231] need a way to produce trampolines not on " pinskia at gcc dot gnu dot org
  2006-09-26  0:44 ` geoffk at gcc dot gnu dot org
@ 2006-09-26  4:06 ` acahalan at gmail dot com
  2009-01-01 21:25 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 8+ messages in thread
From: acahalan at gmail dot com @ 2006-09-26  4:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from acahalan at gmail dot com  2006-09-26 04:06 -------
(In reply to comment #2)
> If you tried the page-of-functions idea, what would you do if you'd used all
> the functions on the page and needed another one?
> 

You'd do the same as if you'd used up all the stack space.
The existing method doesn't handle running out of room,
and I don't see why the requirements would be any different
for this method.


-- 

acahalan at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |acahalan at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29231


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

* [Bug middle-end/29231] need a way to produce trampolines not on the stack
  2006-09-25 23:21 [Bug target/29231] New: powerpc libgcc writes code to " debian-gcc at lists dot debian dot org
  2006-09-25 23:53 ` [Bug middle-end/29231] need a way to produce trampolines not on " pinskia at gcc dot gnu dot org
@ 2006-09-26  0:44 ` geoffk at gcc dot gnu dot org
  2006-09-26  4:06 ` acahalan at gmail dot com
  2009-01-01 21:25 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 8+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2006-09-26  0:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from geoffk at gcc dot gnu dot org  2006-09-26 00:44 -------
If you tried the page-of-functions idea, what would you do if you'd used all
the functions on the page and needed another one?


-- 

geoffk at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29231


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

* [Bug middle-end/29231] need a way to produce trampolines not on the stack
  2006-09-25 23:21 [Bug target/29231] New: powerpc libgcc writes code to " debian-gcc at lists dot debian dot org
@ 2006-09-25 23:53 ` pinskia at gcc dot gnu dot org
  2006-09-26  0:44 ` geoffk at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-25 23:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-09-25 23:53 -------
Really there is no way to fix this without compiler help.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
          Component|target                      |middle-end
 GCC target triplet|powerpc-linux-gnu           |
            Summary|powerpc libgcc writes code  |need a way to produce
                   |to the stack                |trampolines not on the stack


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29231


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

end of thread, other threads:[~2024-04-04 10:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-29231-4@http.gcc.gnu.org/bugzilla/>
2021-11-28  0:02 ` [Bug middle-end/29231] need a way to produce trampolines not on the stack pinskia at gcc dot gnu.org
2024-04-03 23:24 ` pinskia at gcc dot gnu.org
2024-04-04  8:25 ` iains at gcc dot gnu.org
2024-04-04 10:36 ` iains at gcc dot gnu.org
2006-09-25 23:21 [Bug target/29231] New: powerpc libgcc writes code to " debian-gcc at lists dot debian dot org
2006-09-25 23:53 ` [Bug middle-end/29231] need a way to produce trampolines not on " pinskia at gcc dot gnu dot org
2006-09-26  0:44 ` geoffk at gcc dot gnu dot org
2006-09-26  4:06 ` acahalan at gmail dot com
2009-01-01 21:25 ` pinskia at gcc dot gnu dot 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).