public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/49515] New: [4.7 Regression] gcc.dg/torture/tls/thr-init-2.c  -O2  -fpic  execution test failure
@ 2011-06-23 11:20 ubizjak at gmail dot com
  2011-06-23 11:56 ` [Bug target/49515] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2011-06-23 11:20 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.7 Regression] gcc.dg/torture/tls/thr-init-2.c  -O2
                    -fpic  execution test failure
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ubizjak@gmail.com
                CC: rth@gcc.gnu.org
            Target: alpha-linux-gnu


gcc.dg/torture/tls/thr-init-2.c  -O2  -fpic testcase fails on
alphaev68-pc-linux-gnu due to clobbering of $16 register.

The problematic function in the testcase compiles to (-O2 -fpic):

$test_code..ng:
    ldq $27,__tls_get_addr($29)        !literal!1
    lda $30,-16($30)
    stq $26,0($30)
    stq $9,8($30)
    .prologue 1
    mov $16,$9
    lda $16,fstat($29)        !tlsldm!1
    jsr $26,($27),__tls_get_addr        !lituse_tlsldm!1
    ldah $29,0($26)        !gpdisp!3
    ldah $1,fstat($0)        !dtprelhi
    ldq $26,0($30)
    lda $29,0($29)        !gpdisp!3
>>>	ldl $16,fstat($1)		!dtprello
>>>	addl $16,$9,$16
    ldq $9,8($30)
    addl $31,$16,$0
>>>	stl $16,fstat($1)		!dtprello
    lda $30,16($30)
    ret $31,($26),1

$ ./a.out
a=2 fstat=33554434
Aborted

The difference to working code from gcc-4.4.5 is:

@@ -26,17 +26,18 @@
     ldah $1,fstat($0)        !dtprelhi
     ldq $26,0($30)
     lda $29,0($29)        !gpdisp!3
-    ldl $0,fstat($1)        !dtprello
-    addl $0,$9,$0
+    ldl $16,fstat($1)        !dtprello
+    addl $16,$9,$16
     ldq $9,8($30)
-    stl $0,fstat($1)        !dtprello
+    addl $31,$16,$0
+    stl $16,fstat($1)        !dtprello
     lda $30,16($30)
     ret $31,($26),1

Please note that $0 is used instead (extra addl is just a move from $16 to $0).

Does !dtprello relocation need live $16 register? The relevant patterns in
alpha.md do not model that dependancy.


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

end of thread, other threads:[~2011-06-24 10:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-23 11:20 [Bug target/49515] New: [4.7 Regression] gcc.dg/torture/tls/thr-init-2.c -O2 -fpic execution test failure ubizjak at gmail dot com
2011-06-23 11:56 ` [Bug target/49515] " rguenth at gcc dot gnu.org
2011-06-23 15:39 ` rth at gcc dot gnu.org
2011-06-24  7:42 ` ubizjak at gmail dot com
2011-06-24  7:56 ` ubizjak at gmail dot com
2011-06-24 10:02 ` ubizjak 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).