public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/65953] New: [5/6 Regression] undefined reference to static __thread variable
@ 2015-04-30 17:46 trippels at gcc dot gnu.org
  2015-04-30 18:06 ` [Bug tree-optimization/65953] " jakub at gcc dot gnu.org
  2015-04-30 18:43 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-04-30 17:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65953
           Summary: [5/6 Regression] undefined reference to static
                    __thread variable
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org
  Target Milestone: ---

A Gentoo user pointed me to a Mono build failure with gcc-5:

markus@x4 /tmp % cat mini.i
static __thread int *mono_jit_tls;
long mono_get_jit_tls_offset_foo;
int* mono_set_jit_tls_jit_tls;
void
fn1 ()
{
  __asm("movq $mono_jit_tls@TPOFF, %0" : "=r"(mono_get_jit_tls_offset_foo));
}

void
fn2 () { mono_jit_tls = mono_set_jit_tls_jit_tls; }

markus@x4 /tmp % gcc -nostdlib -O2 mini.i
/tmp/ccuc43K9.o:mini.i:function fn1: error: undefined reference to
'mono_jit_tls'
collect2: error: ld returned 1 exit status
markus@x4 /tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.8.4/gcc -nostdlib -O2
mini.i
markus@x4 /tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.2/gcc -nostdlib -O2
mini.i
markus@x4 /tmp % clang -nostdlib -O2 mini.i
markus@x4 /tmp % icc -nostdlib -O2 mini.i
markus@x4 /tmp %


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

* [Bug tree-optimization/65953] [5/6 Regression] undefined reference to static __thread variable
  2015-04-30 17:46 [Bug tree-optimization/65953] New: [5/6 Regression] undefined reference to static __thread variable trippels at gcc dot gnu.org
@ 2015-04-30 18:06 ` jakub at gcc dot gnu.org
  2015-04-30 18:43 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-04-30 18:06 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Looks like a Mono bug to me.  mono_jit_tls isn't __attribute__((used)), and the
compiler determines it is a write-only variable (doesn't know the asm uses it).
Wonder why they use asm at all for this...


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

* [Bug tree-optimization/65953] [5/6 Regression] undefined reference to static __thread variable
  2015-04-30 17:46 [Bug tree-optimization/65953] New: [5/6 Regression] undefined reference to static __thread variable trippels at gcc dot gnu.org
  2015-04-30 18:06 ` [Bug tree-optimization/65953] " jakub at gcc dot gnu.org
@ 2015-04-30 18:43 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-04-30 18:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #1)
> Looks like a Mono bug to me.  mono_jit_tls isn't __attribute__((used)), and
> the compiler determines it is a write-only variable (doesn't know the asm
> uses it).

I can think of one reason, the whole Coroutines and switching of the thread
behind the compiler with getcontext/setcontext.


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

end of thread, other threads:[~2015-04-30 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-30 17:46 [Bug tree-optimization/65953] New: [5/6 Regression] undefined reference to static __thread variable trippels at gcc dot gnu.org
2015-04-30 18:06 ` [Bug tree-optimization/65953] " jakub at gcc dot gnu.org
2015-04-30 18:43 ` pinskia 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).