public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
@ 2012-09-30 17:00 olegendo at gcc dot gnu.org
  2012-09-30 17:01 ` [Bug target/54760] " olegendo at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-09-30 17:00 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 54760
           Summary: [SH] Add __builtin_thread_pointer,
                    __builtin_set_thread_pointer
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: olegendo@gcc.gnu.org
        ReportedBy: olegendo@gcc.gnu.org
            Target: sh*-*-*


SH normally uses GBR to store the address of the thread control block (TCB). 
Other targets have __builtin_thread_pointer and __builtin_set_thread_pointer to
modify such registers.  It has been proposed to make these machine independent
builtins:
http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00428.html

but so far this has not made it into mainline.  In any case the builtin
functions should be added for SH to get/set the GBR.  Moreover, code that
accesses variables in the TCB like

struct tcb
{
  int a, b, c, d;
};

int test (void)
{
  return ((tcb*)__builtin_thread_pointer ())->c;
}

ideally would result in:

  rts
  mov.l  @(8,gbr),r0


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

end of thread, other threads:[~2013-03-09 12:36 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
2012-09-30 17:01 ` [Bug target/54760] " olegendo at gcc dot gnu.org
2012-10-06 11:20 ` olegendo at gcc dot gnu.org
2012-10-08  2:01 ` olegendo at gcc dot gnu.org
2012-10-09 18:59 ` olegendo at gcc dot gnu.org
2012-10-09 19:42 ` olegendo at gcc dot gnu.org
2012-10-11 20:29 ` olegendo at gcc dot gnu.org
2012-10-12  0:14 ` kkojima at gcc dot gnu.org
2012-10-12  0:27 ` olegendo at gcc dot gnu.org
2012-10-12  0:43 ` kkojima at gcc dot gnu.org
2012-10-12  0:46 ` olegendo at gcc dot gnu.org
2012-10-12  0:51 ` olegendo at gcc dot gnu.org
2012-10-15 22:05 ` olegendo at gcc dot gnu.org
2012-10-23 19:25 ` amylaar at gcc dot gnu.org
2012-10-27 13:41 ` olegendo at gcc dot gnu.org
2013-03-09 12:36 ` olegendo 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).