public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/44169]  New: Wrong code while generating TLS offsets
@ 2010-05-17 15:44 gcc at breakpoint dot cc
  2010-05-17 15:44 ` [Bug rtl-optimization/44169] " gcc at breakpoint dot cc
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: gcc at breakpoint dot cc @ 2010-05-17 15:44 UTC (permalink / raw)
  To: gcc-bugs

libgomp testsuite fails with a segfault. It segfaults in
gomp_resolve_num_threads(), accessing the second TLS value.

The first access:
 .LBB28:
         .file 2 "../../../src/libgomp/libgomp.h"
         .loc 2 380 0
         bcl 20,31,$+8
         .long _GLOBAL_OFFSET_TABLE_-$
         mflr 9
         lwz 0,0(9)
         add 9,9,0
         lwz 9,gomp_tls_data@got@tprel(9)
         add 9,9,gomp_tls_data@tls
         lwz 9,40(9)

The second:
.LBE27:
         .loc 1 47 0
         cmpwi 7,3,1
         beq- 7,.L37
 .LVL32:
         .loc 1 49 0
         bcl 20,31,$+8
         .long _GLOBAL_OFFSET_TABLE_-$
         mflr 9
         add 9,9,0
         lwz 9,gomp_tls_data@got@tprel(9)
         add 9,9,gomp_tls_data@tls
         lwz 0,28(9)

After mflr, the lwz is missing. r0 has the offset from last lr which is wrong 
here.
The RTL in tc.c.185r.cprop_hardreg has the lwz included, the next pass  
tc.c.186r.dce does not anymore.

lwz gets not killed if I used -mcpu=power or -mcpu=e300c3. I used -mcpu=8540
which is default for powerpc-linux-gnuspe. -O1 was used in the test case.
The complete cmd line:

 /build/bigeasy/gcc-4.4-4.4.4/build/./gcc/xgcc   \
         -B/build/bigeasy/gcc-4.4-4.4.4/build/./gcc/ \
         -B/usr/powerpc-linux-gnuspe/bin/ \
         -B/usr/powerpc-linux-gnuspe/lib/ \
         -isystem \
         /usr/powerpc-linux-gnuspe/include \
         -isystem \
         /usr/powerpc-linux-gnuspe/sys-include \
         -Werror \
         -pthread \
         -ftls-model=initial-exec \
         -O2 \
         -pthread \
         -fPIC \
         -DPIC \
         tc.c \
         -o \
         tc.S \
         -S \
         -mcpu=8540 \
         -O1 \
         -fdump-rtl-all \
         -c \

A side note: the complete file (parallel.c from libgomp) was compiled with -O2
and the lwz was killed between parallel.c.174r.postreload and
parallel.c.176r.split2.


-- 
           Summary: Wrong code while generating TLS offsets
           Product: gcc
           Version: 4.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc at breakpoint dot cc
 GCC build triplet: powerpc-linux-gnuspe
  GCC host triplet: powerpc-linux-gnuspe
GCC target triplet: powerpc-linux-gnuspe


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


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

end of thread, other threads:[~2010-06-03  3:27 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-17 15:44 [Bug rtl-optimization/44169] New: Wrong code while generating TLS offsets gcc at breakpoint dot cc
2010-05-17 15:44 ` [Bug rtl-optimization/44169] " gcc at breakpoint dot cc
2010-05-17 15:45 ` gcc at breakpoint dot cc
2010-05-17 15:45 ` gcc at breakpoint dot cc
2010-05-18  8:26 ` segher at gcc dot gnu dot org
2010-05-20  4:53 ` Kyle dot D dot Moffett at boeing dot com
2010-05-20 12:10 ` segher at gcc dot gnu dot org
2010-05-20 12:18 ` Kyle dot D dot Moffett at boeing dot com
2010-05-20 12:20 ` Kyle dot D dot Moffett at boeing dot com
2010-05-20 12:30 ` Kyle dot D dot Moffett at boeing dot com
2010-05-20 12:37 ` Kyle dot D dot Moffett at boeing dot com
2010-05-21 15:21 ` gcc at breakpoint dot cc
2010-05-28  2:28 ` amodra at gmail dot com
2010-05-28  2:31 ` amodra at gmail dot com
2010-05-28  2:32 ` amodra at gmail dot com
2010-05-28  7:30 ` amodra at gmail dot com
2010-05-28 13:16 ` amodra at gmail dot com
2010-06-03  2:47 ` amodra at gcc dot gnu dot org
2010-06-03  2:57 ` amodra at gcc dot gnu dot org
2010-06-03  3:09 ` amodra at gcc dot gnu dot org
2010-06-03  3:27 ` amodra at gmail dot com

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