This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/20286] New: gcc panic with __thread attribute


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]