public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/24465]  New: -mminimal-toc miscompilation of __thread vars
@ 2005-10-21  3:40 amodra at bigpond dot net dot au
  2005-10-21  3:47 ` [Bug target/24465] [4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: amodra at bigpond dot net dot au @ 2005-10-21  3:40 UTC (permalink / raw)
  To: gcc-bugs

RS6000_PIC_OFFSET_TABLE_REGNUM isn't being set up for functions that don't need
a constant pool but access __thread vars using __tls_get_addr.

/* Fails with -m64 -mminimal-toc -fPIC */
static __thread int x;
int foo (void)
{
  return x;
}

This is the reason why powerpc64 has been getting lots of libjava failures
since this libjava change: 2005-09-27  Tom Tromey  <tromey@redhat.com>


-- 
           Summary: -mminimal-toc miscompilation of __thread vars
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: target
        AssignedTo: amodra at bigpond dot net dot au
        ReportedBy: amodra at bigpond dot net dot au
GCC target triplet: powerpc64-linux


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


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

* [Bug target/24465] [4.1 Regression] -mminimal-toc miscompilation of __thread vars
  2005-10-21  3:40 [Bug target/24465] New: -mminimal-toc miscompilation of __thread vars amodra at bigpond dot net dot au
@ 2005-10-21  3:47 ` pinskia at gcc dot gnu dot org
  2005-10-21  5:05 ` amodra at bigpond dot net dot au
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-21  3:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2005-10-21 03:47 -------
Confirmed, This is a latent bug but shows up as testsuite regressions which is
why I am marking it as a regression.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2005-10-21 03:47:35
               date|                            |
            Summary|-mminimal-toc miscompilation|[4.1 Regression] -mminimal-
                   |of __thread vars            |toc miscompilation of
                   |                            |__thread vars
   Target Milestone|---                         |4.1.0


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


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

* [Bug target/24465] [4.1 Regression] -mminimal-toc miscompilation of __thread vars
  2005-10-21  3:40 [Bug target/24465] New: -mminimal-toc miscompilation of __thread vars amodra at bigpond dot net dot au
  2005-10-21  3:47 ` [Bug target/24465] [4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-10-21  5:05 ` amodra at bigpond dot net dot au
  2005-10-21  7:33 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: amodra at bigpond dot net dot au @ 2005-10-21  5:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from amodra at bigpond dot net dot au  2005-10-21 05:05 -------
Actually, it's not that RS6000_PIC_OFFSET_TABLE_REGNUM isn't being set up, it's
that RS6000_PIC_OFFSET_TABLE_REGNUM is wrongly being using for tls accesses. 
As currently implemented by gcc, powerpc tls uses x@got@tlsgd and similar.  ie.
we are expecting the linker to manage allocation of tls entries in the got
rather than having gcc allocate them itself in toc sections.  This means that
powerpc64 should use r2 for tls always, even when -mminimal-toc.

Testing the following fix.

Index: gcc/config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.872
diff -u -p -r1.872 rs6000.c
--- gcc/config/rs6000/rs6000.c  6 Oct 2005 22:58:59 -0000       1.872
+++ gcc/config/rs6000/rs6000.c  21 Oct 2005 05:02:57 -0000
@@ -2979,7 +2979,7 @@ rs6000_legitimize_tls_address (rtx addr,
       rtx r3, got, tga, tmp1, tmp2, eqv;

       if (TARGET_64BIT)
-       got = gen_rtx_REG (Pmode, TOC_REGISTER);
+       got = gen_rtx_REG (Pmode, 2);
       else
        {
          if (flag_pic == 1)


-- 

amodra at bigpond dot net dot au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.0                       |---


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


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

* [Bug target/24465] [4.1 Regression] -mminimal-toc miscompilation of __thread vars
  2005-10-21  3:40 [Bug target/24465] New: -mminimal-toc miscompilation of __thread vars amodra at bigpond dot net dot au
  2005-10-21  3:47 ` [Bug target/24465] [4.1 Regression] " pinskia at gcc dot gnu dot org
  2005-10-21  5:05 ` amodra at bigpond dot net dot au
@ 2005-10-21  7:33 ` cvs-commit at gcc dot gnu dot org
  2005-10-21  7:37 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-10-21  7:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from cvs-commit at gcc dot gnu dot org  2005-10-21 07:33 -------
Subject: Bug 24465

CVSROOT:        /cvs/gcc
Module name:    gcc
Changes by:     amodra@gcc.gnu.org      2005-10-21 07:33:30

Modified files:
        gcc            : ChangeLog 
        gcc/config/rs6000: rs6000.c 

Log message:
        PR target/24465
        * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Always
        use r2 for 64-bit tls .got access.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.10197&r2=2.10198
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&r1=1.872&r2=1.873


-- 


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


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

* [Bug target/24465] [4.1 Regression] -mminimal-toc miscompilation of __thread vars
  2005-10-21  3:40 [Bug target/24465] New: -mminimal-toc miscompilation of __thread vars amodra at bigpond dot net dot au
                   ` (2 preceding siblings ...)
  2005-10-21  7:33 ` cvs-commit at gcc dot gnu dot org
@ 2005-10-21  7:37 ` cvs-commit at gcc dot gnu dot org
  2005-10-21  7:48 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-10-21  7:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from cvs-commit at gcc dot gnu dot org  2005-10-21 07:37 -------
Subject: Bug 24465

CVSROOT:        /cvs/gcc
Module name:    gcc
Branch:         gcc-4_0-branch
Changes by:     amodra@gcc.gnu.org      2005-10-21 07:36:56

Modified files:
        gcc            : ChangeLog 
        gcc/config/rs6000: rs6000.c 

Log message:
        PR target/24465
        * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Always
        use r2 for 64-bit tls .got access.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.475&r2=2.7592.2.476
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.788.2.11&r2=1.788.2.12


-- 


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


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

* [Bug target/24465] [4.1 Regression] -mminimal-toc miscompilation of __thread vars
  2005-10-21  3:40 [Bug target/24465] New: -mminimal-toc miscompilation of __thread vars amodra at bigpond dot net dot au
                   ` (3 preceding siblings ...)
  2005-10-21  7:37 ` cvs-commit at gcc dot gnu dot org
@ 2005-10-21  7:48 ` cvs-commit at gcc dot gnu dot org
  2005-10-21  7:49 ` amodra at bigpond dot net dot au
  2005-10-21 12:59 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-10-21  7:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from cvs-commit at gcc dot gnu dot org  2005-10-21 07:48 -------
Subject: Bug 24465

CVSROOT:        /cvs/gcc
Module name:    gcc
Branch:         gcc-3_4-branch
Changes by:     amodra@gcc.gnu.org      2005-10-21 07:48:26

Modified files:
        gcc            : ChangeLog 
        gcc/config/rs6000: rs6000.c 

Log message:
        PR target/24465
        * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Always
        use r2 for 64-bit tls .got access.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.925&r2=2.2326.2.926
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.576.2.46&r2=1.576.2.47


-- 


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


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

* [Bug target/24465] [4.1 Regression] -mminimal-toc miscompilation of __thread vars
  2005-10-21  3:40 [Bug target/24465] New: -mminimal-toc miscompilation of __thread vars amodra at bigpond dot net dot au
                   ` (4 preceding siblings ...)
  2005-10-21  7:48 ` cvs-commit at gcc dot gnu dot org
@ 2005-10-21  7:49 ` amodra at bigpond dot net dot au
  2005-10-21 12:59 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: amodra at bigpond dot net dot au @ 2005-10-21  7:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from amodra at bigpond dot net dot au  2005-10-21 07:49 -------
Fixed on all active branches


-- 

amodra at bigpond dot net dot au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.1.0


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


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

* [Bug target/24465] [4.1 Regression] -mminimal-toc miscompilation of __thread vars
  2005-10-21  3:40 [Bug target/24465] New: -mminimal-toc miscompilation of __thread vars amodra at bigpond dot net dot au
                   ` (5 preceding siblings ...)
  2005-10-21  7:49 ` amodra at bigpond dot net dot au
@ 2005-10-21 12:59 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-21 12:59 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.0.0 3.4.4 4.0.2
      Known to work|                            |3.4.5 4.0.3 4.1.0
   Target Milestone|4.1.0                       |3.4.5


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


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

end of thread, other threads:[~2005-10-21 12:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-21  3:40 [Bug target/24465] New: -mminimal-toc miscompilation of __thread vars amodra at bigpond dot net dot au
2005-10-21  3:47 ` [Bug target/24465] [4.1 Regression] " pinskia at gcc dot gnu dot org
2005-10-21  5:05 ` amodra at bigpond dot net dot au
2005-10-21  7:33 ` cvs-commit at gcc dot gnu dot org
2005-10-21  7:37 ` cvs-commit at gcc dot gnu dot org
2005-10-21  7:48 ` cvs-commit at gcc dot gnu dot org
2005-10-21  7:49 ` amodra at bigpond dot net dot au
2005-10-21 12:59 ` pinskia at gcc dot gnu dot 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).