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

* [Bug target/66470] [4.8/4.9/5/6 Regression] TLS ICE due to ix86_split_long_move
  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 ` mpolacek at gcc dot gnu.org
  2015-06-09  9:12 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-06-09  9:09 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-06-09
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.


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

* [Bug target/66470] [4.8/4.9/5/6 Regression] TLS ICE due to ix86_split_long_move
  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
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-09  9:12 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.5


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

* [Bug target/66470] [4.8/4.9/5/6 Regression] TLS ICE due to ix86_split_long_move
  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
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-09 10:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 35724
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35724&action=edit
gcc6-pr66470.patch

Untested fix.


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

* [Bug target/66470] [4.8/4.9/5/6 Regression] TLS ICE due to ix86_split_long_move
  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
                   ` (2 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-10  9:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Jun 10 09:12:53 2015
New Revision: 224319

URL: https://gcc.gnu.org/viewcvs?rev=224319&root=gcc&view=rev
Log:
        PR target/66470
        * config/i386/i386.c (ix86_split_long_move): For collisions
        involving direct tls segment refs, move the UNSPEC_TP possibly
        wrapped in ZERO_EXTEND out of the address for lea, to each of
        the memory loads.

        * gcc.dg/tls/pr66470.c: New test.
        * gcc.target/i386/pr66470.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/tls/pr66470.c
    trunk/gcc/testsuite/gcc.target/i386/pr66470.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug target/66470] [4.8/4.9/5/6 Regression] TLS ICE due to ix86_split_long_move
  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
                   ` (3 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-10  9:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Jun 10 09:16:16 2015
New Revision: 224320

URL: https://gcc.gnu.org/viewcvs?rev=224320&root=gcc&view=rev
Log:
        PR target/66470
        * config/i386/i386.c (ix86_split_long_move): For collisions
        involving direct tls segment refs, move the UNSPEC_TP possibly
        wrapped in ZERO_EXTEND out of the address for lea, to each of
        the memory loads.

        * gcc.dg/tls/pr66470.c: New test.
        * gcc.target/i386/pr66470.c: New test.

Added:
    branches/gcc-5-branch/gcc/testsuite/gcc.dg/tls/pr66470.c
    branches/gcc-5-branch/gcc/testsuite/gcc.target/i386/pr66470.c
Modified:
    branches/gcc-5-branch/gcc/ChangeLog
    branches/gcc-5-branch/gcc/config/i386/i386.c
    branches/gcc-5-branch/gcc/testsuite/ChangeLog


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

* [Bug target/66470] [4.8/4.9/5/6 Regression] TLS ICE due to ix86_split_long_move
  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
                   ` (4 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-10  9:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Jun 10 09:26:06 2015
New Revision: 224321

URL: https://gcc.gnu.org/viewcvs?rev=224321&root=gcc&view=rev
Log:
        PR target/66470
        * config/i386/i386.c (ix86_split_long_move): For collisions
        involving direct tls segment refs, move the UNSPEC_TP possibly
        wrapped in ZERO_EXTEND out of the address for lea, to each of
        the memory loads.

        * gcc.dg/tls/pr66470.c: New test.
        * gcc.target/i386/pr66470.c: New test.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/tls/pr66470.c
    branches/gcc-4_9-branch/gcc/testsuite/gcc.target/i386/pr66470.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/config/i386/i386.c
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog


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

* [Bug target/66470] [4.8/4.9/5/6 Regression] TLS ICE due to ix86_split_long_move
  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
                   ` (5 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-10  9:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Jun 10 09:34:21 2015
New Revision: 224322

URL: https://gcc.gnu.org/viewcvs?rev=224322&root=gcc&view=rev
Log:
        PR target/66470
        * config/i386/i386.c (ix86_split_long_move): For collisions
        involving direct tls segment refs, move the UNSPEC_TP possibly
        wrapped in ZERO_EXTEND out of the address for lea, to each of
        the memory loads.

        * gcc.dg/tls/pr66470.c: New test.
        * gcc.target/i386/pr66470.c: New test.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/tls/pr66470.c
    branches/gcc-4_8-branch/gcc/testsuite/gcc.target/i386/pr66470.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/config/i386/i386.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


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

* [Bug target/66470] [4.8/4.9/5/6 Regression] TLS ICE due to ix86_split_long_move
  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
                   ` (6 preceding siblings ...)
  2015-06-10  9:34 ` jakub at gcc dot gnu.org
@ 2015-06-10  9:35 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-10  9:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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