Bug 331767

Summary: GCC crosscompiler miscompile
Product: [openSUSE] openSUSE 10.3 Reporter: Jan Blunck <jblunck>
Component: DevelopmentAssignee: Michael Matz <matz>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P5 - None CC: rguenther
Version: Final   
Target Milestone: ---   
Hardware: x86   
OS: Other   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 331032    
Attachments: A testcase

Description Jan Blunck 2007-10-08 10:46:53 UTC
The crosscompiler i386->x86_64 is miscompiling the vararg code found in openssh's debug function (see bug 331032). The compiler can be found in /mounts/work2/CDs/icecream/envs/14d9890e01e58367a641b63a2248e063/x86_64.A testcase is attached.

Miscompilation:

0000000000000540 <debug>:
 540:   48 81 ec d8 00 00 00    sub    $0xd8,%rsp
 547:   48 89 54 24 30          mov    %rdx,0x30(%rsp)
 54c:   0f b6 d0                movzbl %al,%edx
 54f:   48 89 74 24 28          mov    %rsi,0x28(%rsp)
 554:   48 8d 04 95 00 00 00    lea    0x0(,%rdx,4),%rax
 55b:   00 
 55c:   48 8d 15 2c 00 00 00    lea    0x2c(%rip),%rdx        # 58f <debug+0x4f>
 563:   48 89 4c 24 38          mov    %rcx,0x38(%rsp)
 568:   4c 89 44 24 40          mov    %r8,0x40(%rsp)
 56d:   4c 89 4c 24 48          mov    %r9,0x48(%rsp)
 572:   48 89 fe                mov    %rdi,%rsi
 575:   48 29 c2                sub    %rax,%rdx
 578:   48 8d 84 24 cf 00 00    lea    0xcf(%rsp),%rax
 57f:   00 
 580:   bf 05 00 00 00          mov    $0x5,%edi
 585:   ff e2                   jmpq   *%rdx
 587:   0f 29 78 f1             movaps %xmm7,-0xf(%rax)       <----
 58b:   0f 29 70 e1             movaps %xmm6,-0x1f(%rax)      <----
 58f:   48 8d 84 24 e0 00 00    lea    0xe0(%rsp),%rax
 596:   00 
 597:   48 89 e2                mov    %rsp,%rdx
 59a:   c7 04 24 08 00 00 00    movl   $0x8,(%rsp)
Comment 1 Jan Blunck 2007-10-08 10:48:16 UTC
Created attachment 176767 [details]
A testcase
Comment 2 Michael Matz 2007-10-09 17:42:43 UTC
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33714
Comment 3 Richard Biener 2007-10-15 07:57:00 UTC
Fixed.