public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/20286] New: gcc panic with __thread attribute
@ 2005-03-02 16:29 eranian at hpl dot hp dot com
  2005-03-02 16:42 ` [Bug target/20286] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: eranian at hpl dot hp dot com @ 2005-03-02 16:29 UTC (permalink / raw)
  To: gcc-bugs

The current PAPI (icl.cs.utk.edu) source code does not compile
on Debian/testing on IA-64. The current gcc 3.3.5 panics when
compiling threads.c. I narrowed down the problem to the following
code fragment:

typedef struct _ThreadInfo {
  unsigned long int tid;
} ThreadInfo_t;
extern __thread ThreadInfo_t *_papi_hwi_my_thread;
inline static ThreadInfo_t *_papi_hwi_lookup_thread(void)
{

  { ; };
  return(_papi_hwi_my_thread);
}
__thread ThreadInfo_t *_papi_hwi_my_thread;

t2.c:15: internal compiler error: in ia64_encode_section_info, at
config/ia64/ia64.c:7363

The problem disappear if the definition of
the variable is moved before the inline function, i.e.,
before it is used.

The problem is also present on 3.3.4. I believe it is gone
from 3.4.0.

-- 
           Summary: gcc panic with __thread attribute
           Product: gcc
           Version: 3.3.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eranian at hpl dot hp dot com
                CC: gcc-bugs at gcc dot gnu dot org,wilson at specifixinc
                    dot com
 GCC build triplet: ia64-linux
  GCC host triplet: ia64-linux
GCC target triplet: ia64-linux


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


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

* [Bug target/20286] gcc panic with __thread attribute
  2005-03-02 16:29 [Bug c/20286] New: gcc panic with __thread attribute eranian at hpl dot hp dot com
@ 2005-03-02 16:42 ` pinskia at gcc dot gnu dot org
  2005-03-02 16:48 ` [Bug target/20286] [3.3 only] " pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-02 16:42 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target
           Keywords|                            |ice-on-valid-code


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


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

* [Bug target/20286] [3.3 only] gcc panic with __thread attribute
  2005-03-02 16:29 [Bug c/20286] New: gcc panic with __thread attribute eranian at hpl dot hp dot com
  2005-03-02 16:42 ` [Bug target/20286] " pinskia at gcc dot gnu dot org
@ 2005-03-02 16:48 ` pinskia at gcc dot gnu dot org
  2005-03-24  0:10 ` wilson at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-02 16:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-03-02 16:48 -------
Fixed in 3.4.0 by
<http://gcc.gnu.org/ml/gcc-patches/2003-04/msg01251.html>.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |3.3.5 3.3.4
      Known to work|                            |3.4.0 4.0.0
   Last reconfirmed|0000-00-00 00:00:00         |2005-03-02 16:48:16
               date|                            |
            Summary|gcc panic with __thread     |[3.3 only] gcc panic with
                   |attribute                   |__thread attribute
   Target Milestone|---                         |3.3.6


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


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

* [Bug target/20286] [3.3 only] gcc panic with __thread attribute
  2005-03-02 16:29 [Bug c/20286] New: gcc panic with __thread attribute eranian at hpl dot hp dot com
  2005-03-02 16:42 ` [Bug target/20286] " pinskia at gcc dot gnu dot org
  2005-03-02 16:48 ` [Bug target/20286] [3.3 only] " pinskia at gcc dot gnu dot org
@ 2005-03-24  0:10 ` wilson at gcc dot gnu dot org
  2005-03-25 22:13 ` gdr at integrable-solutions dot net
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: wilson at gcc dot gnu dot org @ 2005-03-24  0:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wilson at gcc dot gnu dot org  2005-03-24 00:09 -------
That patch that fixed this in gcc-3.4 is too large to backport, particularly
when considering that it depends on other stuff (such as
default_encode_section_info) which is not already present in gcc-3.3.  However,
it can be fixed with a simpler patch.

The underlying problem is that a variable changes state from
TLS_MODEL_INTIAL_EXEC (extern) to TLS_MODEL_LOCAL_EXEC (static).  This is an
allowable transition.  This unfortunately triggers an abort in the ia64.c
backend in ia64_encode_section_info.  The comment next to the abort makes it
clear that this is checking for transitions  between thread data and small data.
 So the fix is to tighten the conditions under which we call the abort to match
the conditions documented in the comments.

The same INITIAL_EXEC to LOCAL_EXEC transition happens in gcc-3.4, there just
isn't a corresponding abort in default_encode_section_info.

Technically, this isn't a regression, as gcc-3.2 did not have TLS support, and
gcc-3.3 is only open for regression fixes, so there is the question of whether
this patch is OK to install on the branch.  A strict interpretation of the rules
says this is not OK, at least not without approval of the branch maintainer, Gaby.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |wilson at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-03-02 16:48:16         |2005-03-24 00:09:55
               date|                            |


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


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

* [Bug target/20286] [3.3 only] gcc panic with __thread attribute
  2005-03-02 16:29 [Bug c/20286] New: gcc panic with __thread attribute eranian at hpl dot hp dot com
                   ` (2 preceding siblings ...)
  2005-03-24  0:10 ` wilson at gcc dot gnu dot org
@ 2005-03-25 22:13 ` gdr at integrable-solutions dot net
  2005-03-28 22:40 ` wilson at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gdr at integrable-solutions dot net @ 2005-03-25 22:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at integrable-solutions dot net  2005-03-25 22:13 -------
Subject: Re:  [3.3 only] gcc panic with __thread attribute

"wilson at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| Technically, this isn't a regression, as gcc-3.2 did not have TLS
| support, and gcc-3.3 is only open for regression fixes, so there is
| the question of whether  this patch is OK to install on the branch.
| A strict interpretation of the rules says this is not OK, at least
| not without approval of the branch maintainer, Gaby. 

I'm inclined to accept a simpler patch.

-- Gaby


-- 


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


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

* [Bug target/20286] [3.3 only] gcc panic with __thread attribute
  2005-03-02 16:29 [Bug c/20286] New: gcc panic with __thread attribute eranian at hpl dot hp dot com
                   ` (3 preceding siblings ...)
  2005-03-25 22:13 ` gdr at integrable-solutions dot net
@ 2005-03-28 22:40 ` wilson at gcc dot gnu dot org
  2005-03-29  0:32 ` cvs-commit at gcc dot gnu dot org
  2005-03-29  0:33 ` wilson at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: wilson at gcc dot gnu dot org @ 2005-03-28 22:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wilson at gcc dot gnu dot org  2005-03-28 22:40 -------
The patch passed testing, and has been submitted to gcc-patches here:
    http://gcc.gnu.org/ml/gcc-patches/2005-03/msg02542.html


-- 


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


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

* [Bug target/20286] [3.3 only] gcc panic with __thread attribute
  2005-03-02 16:29 [Bug c/20286] New: gcc panic with __thread attribute eranian at hpl dot hp dot com
                   ` (4 preceding siblings ...)
  2005-03-28 22:40 ` wilson at gcc dot gnu dot org
@ 2005-03-29  0:32 ` cvs-commit at gcc dot gnu dot org
  2005-03-29  0:33 ` wilson at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-03-29  0:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-03-29 00:32 -------
Subject: Bug 20286

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	wilson@gcc.gnu.org	2005-03-29 00:32:03

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

Log message:
	Fix problem with redefining extern __thread as static __thread.
	PR target/20286.
	* config/ia64/ia64.c (ia64_encode_section_info): Only abort if encoding
	or symbol_str[1] is 's'.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.1061&r2=1.16114.2.1062
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ia64/ia64.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.198.2.24&r2=1.198.2.25



-- 


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


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

* [Bug target/20286] [3.3 only] gcc panic with __thread attribute
  2005-03-02 16:29 [Bug c/20286] New: gcc panic with __thread attribute eranian at hpl dot hp dot com
                   ` (5 preceding siblings ...)
  2005-03-29  0:32 ` cvs-commit at gcc dot gnu dot org
@ 2005-03-29  0:33 ` wilson at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: wilson at gcc dot gnu dot org @ 2005-03-29  0:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From wilson at gcc dot gnu dot org  2005-03-29 00:33 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to work|3.4.0 4.0.0                 |3.4.0 4.0.0 3.3.6
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2005-03-29  0:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-02 16:29 [Bug c/20286] New: gcc panic with __thread attribute eranian at hpl dot hp dot com
2005-03-02 16:42 ` [Bug target/20286] " pinskia at gcc dot gnu dot org
2005-03-02 16:48 ` [Bug target/20286] [3.3 only] " pinskia at gcc dot gnu dot org
2005-03-24  0:10 ` wilson at gcc dot gnu dot org
2005-03-25 22:13 ` gdr at integrable-solutions dot net
2005-03-28 22:40 ` wilson at gcc dot gnu dot org
2005-03-29  0:32 ` cvs-commit at gcc dot gnu dot org
2005-03-29  0:33 ` wilson 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).