From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15049 invoked by alias); 23 Apr 2003 07:42:12 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 15032 invoked from network); 23 Apr 2003 07:42:07 -0000 Received: from unknown (HELO www6.chinadns.com) (211.154.211.69) by sources.redhat.com with SMTP; 23 Apr 2003 07:42:07 -0000 Received: (qmail 6008 invoked from network); 23 Apr 2003 07:41:43 -0000 Received: from unknown (HELO magima.com.cn) (zhangjie@magima.com.cn@unknown) by unknown with SMTP; 23 Apr 2003 07:41:43 -0000 Message-ID: <3EA643B9.9090404@magima.com.cn> Date: Wed, 23 Apr 2003 10:36:00 -0000 From: Jie Zhang User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4a) Gecko/20030401 X-Accept-Language: en-us, en, zh, ja MIME-Version: 1.0 To: gcc@gcc.gnu.org Subject: An error of gcc-ss-20030303 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg01134.txt.bz2 The following code is copied from spinlock.c in uClibc (after preprocessing and 'inline' after static removed): static void __pthread_release(int * spinlock) { asm ("" : : : "memory"); *spinlock = 0; __asm __volatile ("" : "=m" (*spinlock) : "0" (*spinlock)); } When compiled using gcc-3.0.2, no error is reported. But gcc-3.2 and gcc-ss-20030303 report the follwing error: t.c: In function `__pthread_release': t.c:5: inconsistent operand constraints in an `asm' I dump the rtl using -dr and find that gcc-3.0.2 uses a pseudo register to hold the address of 'spinlock' and the output operand and input operand of __asm__ use the same register. But gcc-ss-20030303 uses two pseudo registers for the output operand and input operand of __asm__ respectively, both pseudo registers hold the same value -- the address of 'spinlock'. Then when checking the constraints, gcc reports the error. Is it a bug of gcc-3.2.x and gcc-3.3? Or the above __asm__ usage is wrong in gcc-3.2.x and gcc-3.3? I think gcc-3.0.2 is right? - Jie