public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ppluzhnikov at google dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/58066] GCC mis-compiles access to TLS variable with -fPIC on x86_64
Date: Tue, 06 Aug 2013 23:14:00 -0000	[thread overview]
Message-ID: <bug-58066-4-ZltqMKAKzt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-58066-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
(In reply to Paul Pluzhnikov from comment #2)

> What is the way to turn it on?

Compiling test case with -mtls-dialect=gnu2 does appear to improve the picture:

g++ -fPIC -O2 -S t.cc -mtls-dialect=gnu2

__cxa_get_globals:
        leaq    _ZL3ccc@TLSDESC(%rip), %rax
        call    *_ZL3ccc@TLSCALL(%rax)
        addq    %fs:0, %rax
        ret

The indirect call goes to _dl_tlsdesc_dynamic in ld-linux-x86-64.so.2 with
misaligned stack, and the latter re-aligns it.


  parent reply	other threads:[~2013-08-06 23:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-02 23:12 [Bug c/58066] New: " ppluzhnikov at google dot com
2013-08-02 23:57 ` [Bug target/58066] " pinskia at gcc dot gnu.org
2013-08-06 23:14 ` ppluzhnikov at google dot com [this message]
2014-03-12 21:05 ` hjl.tools at gmail dot com
2014-03-12 22:22 ` hjl.tools at gmail dot com
2014-05-19  5:26 ` wmi at gcc dot gnu.org
2014-12-18 17:54 ` dvyukov at google dot com
2015-07-11 21:03 ` [Bug target/58066] __tls_get_addr is called with misaligned stack on x86-64 hjl.tools at gmail dot com
2015-07-13  3:58 ` hjl.tools at gmail dot com
2015-07-13  6:41 ` ubizjak at gmail dot com
2015-07-13  9:16 ` [Bug rtl-optimization/58066] " ubizjak at gmail dot com
2015-07-13 11:08 ` ubizjak at gmail dot com
2015-07-13 12:08 ` hjl.tools at gmail dot com
2015-07-15  7:40 ` uros at gcc dot gnu.org
2015-07-15  7:41 ` [Bug target/58066] " ubizjak at gmail dot com
2015-07-15 13:42 ` uros at gcc dot gnu.org
2015-07-23 18:52 ` uros at gcc dot gnu.org
2015-07-30  8:54 ` uros at gcc dot gnu.org
2015-07-30  9:00 ` ubizjak at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-58066-4-ZltqMKAKzt@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).