From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5109 invoked by alias); 18 Jan 2007 22:22:58 -0000 Received: (qmail 5036 invoked by uid 48); 18 Jan 2007 22:22:48 -0000 Date: Thu, 18 Jan 2007 22:22:00 -0000 Subject: [Bug inline-asm/30505] New: [4.2 regression] asm operand has impossible constraints. X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pluto at agmk dot net" 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: 2007-01/txt/msg01511.txt.bz2 following testcase works fine with gcc-3.3/4.1: typedef unsigned long long uint64; typedef unsigned uint32; uint64 dividend; uint32 divisor; uint64 quotient; uint32 remainder; void div643264( ) { uint32 hQuotient; uint32 lQuotient; __asm__( "divl %5" "\n\t" "movl %%eax, %0" "\n\t" "movl %4, %%eax" "\n\t" "divl %5" : "=&rm" (hQuotient), //0 r/m "=a" (lQuotient), //1 eax "=d" (remainder) //2 edx : "1" ((uint32)(dividend >> 32)), //3 eax "g" ((uint32)dividend), //4 r/m "rm" (divisor), //5 r/m "2" (0) //6 edx : "cc" ); quotient = (uint64)hQuotient << 32 | lQuotient; } e.g. 4.1 produces: $ gcc div.c -fno-builtin -S -O2 && cat div.s div643264: pushl %ebp movl %esp, %ebp subl $12, %esp movl dividend, %ecx movl %ebx, (%esp) movl dividend+4, %ebx movl %esi, 4(%esp) xorl %esi, %esi movl %edi, 8(%esp) movl %esi, %edx movl 4(%esp), %esi movl %ebx, %ecx xorl %ebx, %ebx movl %ecx, %eax #APP divl divisor movl %eax, %edi movl dividend, %eax divl divisor #NO_APP movl %eax, %ebx movl %edi, %eax movl %edx, remainder xorl %edx, %edx movl %eax, %edx movl %ebx, quotient movl %edx, quotient+4 movl (%esp), %ebx movl $0, %eax movl 8(%esp), %edi leave ret 4.2 rejects such code. div.c: In function ‘div643264’: div.c:15: error: ‘asm’ operand has impossible constraints -- Summary: [4.2 regression] asm operand has impossible constraints. Product: gcc Version: 4.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: inline-asm AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pluto at agmk dot net GCC target triplet: i686 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30505