public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/66470] New: [4.8/4.9/5/6 Regression] TLS ICE due to ix86_split_long_move
Date: Tue, 09 Jun 2015 09:08:00 -0000	[thread overview]
Message-ID: <bug-66470-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 66470
           Summary: [4.8/4.9/5/6 Regression] TLS ICE due to
                    ix86_split_long_move
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

extern __thread unsigned long long a[10];
unsigned long long foo (int b) { return a[b]; }

or

extern __thread struct S { int a, b; } a[10];
struct S foo (int b) { return a[b]; }

ICE on x86_64-linux/i686-linux with -m32, all optimization levels.  This worked
in GCC 3.3.6.
The bug is in ix86_split_long_move, when trying to split:
(insn 7 15 13 2 (set (reg:DI 0 ax [92])
        (mem:DI (plus:SI (plus:SI (mult:SI (reg/v:SI 1 dx [orig:89 b ] [89])
                        (const_int 8 [0x8]))
                    (unspec:SI [
                            (const_int 0 [0])
                        ] UNSPEC_TP))
                (reg:SI 0 ax [91])) [1 a S8 A64])) rh1212265.i:2 85
{*movdi_internal}
     (nil))
which, while offsettable, has collisions == 2 (the MEM uses both dx and ax in
the addressing and loads the ax:dx pair).  The splitter assumes it can just use
a lea, but lea can't support %gs: (UNSPEC_TP).  So, either it has to load from
%gs:0 first, then do lea, or better yet just move UNSPEC_TP part to the
individual memory loads.


             reply	other threads:[~2015-06-09  9:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-09  9:08 jakub at gcc dot gnu.org [this message]
2015-06-09  9:09 ` [Bug target/66470] " mpolacek at gcc dot gnu.org
2015-06-09  9:12 ` rguenth at gcc dot gnu.org
2015-06-09 10:07 ` jakub at gcc dot gnu.org
2015-06-10  9:13 ` jakub at gcc dot gnu.org
2015-06-10  9:16 ` jakub at gcc dot gnu.org
2015-06-10  9:26 ` jakub at gcc dot gnu.org
2015-06-10  9:34 ` jakub at gcc dot gnu.org
2015-06-10  9:35 ` jakub at gcc dot gnu.org

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-66470-4@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).