public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/66470] New: [4.8/4.9/5/6 Regression] TLS ICE due to ix86_split_long_move
@ 2015-06-09  9:08 jakub at gcc dot gnu.org
  2015-06-09  9:09 ` [Bug target/66470] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-09  9:08 UTC (permalink / raw)
  To: gcc-bugs

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.


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

end of thread, other threads:[~2015-06-10  9:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-09  9:08 [Bug target/66470] New: [4.8/4.9/5/6 Regression] TLS ICE due to ix86_split_long_move jakub at gcc dot gnu.org
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

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).