From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17690 invoked by alias); 23 Jun 2011 11:20:53 -0000 Received: (qmail 17679 invoked by uid 22791); 23 Jun 2011 11:20:52 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Jun 2011 11:20:38 +0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/49515] New: [4.7 Regression] gcc.dg/torture/tls/thr-init-2.c -O2 -fpic execution test failure X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Date: Thu, 23 Jun 2011 11:20:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg02066.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D49515 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=3D2 fstat=3D33554434 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.