From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31382 invoked by alias); 20 Aug 2008 14:28:12 -0000 Received: (qmail 31369 invoked by uid 22791); 20 Aug 2008 14:28:11 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 20 Aug 2008 14:27:17 +0000 Received: from zps76.corp.google.com (zps76.corp.google.com [172.25.146.76]) by smtp-out.google.com with ESMTP id m7KEQYLD022463; Wed, 20 Aug 2008 15:26:34 +0100 Received: from smtp.corp.google.com (spacemonkey1.corp.google.com [192.168.120.115]) by zps76.corp.google.com with ESMTP id m7KEQWlM025065 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 20 Aug 2008 07:26:33 -0700 Received: from localhost.localdomain.google.com (69-36-227-135.cust.layer42.net [69.36.227.135] (may be forged)) (authenticated bits=0) by smtp.corp.google.com (8.13.8/8.13.8) with ESMTP id m7KEQPfO013562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 20 Aug 2008 07:26:31 -0700 To: Jeroen Demeyer Cc: gcc-help@gcc.gnu.org Subject: Re: Inline assembly constraints question References: <48A937FE.30100@cage.ugent.be> <48AC1FC6.4060308@cage.ugent.be> From: Ian Lance Taylor Date: Wed, 20 Aug 2008 19:31:00 -0000 In-Reply-To: <48AC1FC6.4060308@cage.ugent.be> (Jeroen Demeyer's message of "Wed\, 20 Aug 2008 15\:44\:38 +0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-08/txt/msg00203.txt.bz2 Jeroen Demeyer writes: > This is the full asm statement: > asm("# number_t& number_t::operator>>=(unsigned char s)\n" > " shrdl %6, %4, %3\n" > " movl %3, %0\n" > " movl %5, %2\n" > " shrdl %6, %2, %1\n" > " shrl %6, %2\n" > : "=&rm" (n0), "=&r" (n1), "=&r" (n2) > : "2" (n0), "1" (n1), "g" (n2), "cI" (s) > ); > > The code generated is the following: > shrdl %cl, %esi, %eax > movl %eax, -4384(%ebp) > movl -4384(%ebp), %eax > shrdl %cl, %eax, %esi > shrl %cl, %eax > > As you can see, %0 and %5 both become -4384(%ebp). > See attachment for the output from -dg. Thanks for the details. Unfortunately, I am no wiser. As far as I can tell, this should work correctly. Either you've found a bug, or I'm missing something. If you like, and you want to help others avoid this problem, please file a bug report with the preprocessed source code and command line at http://gcc.gnu.org/bugzilla/ . For more information about filing bug reports see http://gcc.gnu.org/bugs.html . If you just want to fix it for yourself change constraint 0 to "=&r" or change constraint 5 to "r". Ian