From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3934 invoked by alias); 15 Nov 2010 18:19:05 -0000 Received: (qmail 3923 invoked by uid 22791); 15 Nov 2010 18:19:04 -0000 X-SWARE-Spam-Status: No, hits=-2.8 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; Mon, 15 Nov 2010 18:18:17 +0000 From: "law at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/46479] [4.4/4.5/4.6 Regression] "+m" (*regs) : "a" (regs) doesn't use (%eax) for the MEM X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: law at redhat dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.4.6 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 15 Nov 2010 18:34: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: 2010-11/txt/msg01957.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46479 --- Comment #3 from Jeffrey A. Law 2010-11-15 18:17:26 UTC --- On 11/15/10 08:07, jakub at gcc dot gnu.org wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46479 > > --- Comment #2 from Jakub Jelinek 2010-11-15 15:00:37 UTC --- > Perhaps you're right, if > asm ("movl $0, %0; movl $1, %1" : "=g" (x), "=g" (y)) > would be allowed to use register for x and memory for y and use the register > chosen for x as address of memory chosen for y, then the above one wouldn't > work without early clobbers, eventhough no inputs are consumed after first > output is written. > That would mean gccs before 4.0 were buggy. In general, I wouldn't think a register used in an output address would be valid in another output. There may be cases where it works, depending on what gets reloaded and the ordering of operands, etc, but writing code which depended on allowing the same reg to be used in both circumstances, knowing reload would DTRT because of how the asm was written would be, umm, bad. > Now, perhaps we could see if the output operand for the MEM is ever referenced > in the asm template, but then we are jumping into the territory of different > code generation depending on what is actually appears in the template, not sure > if we want to go there (well, we already base inlining decisions etc.on the > quess count of insns in the template). I really don't like the idea of peeking in the template. > In any case, having a way to express some memory is clobbered without actually > forcing its address to be passed to the inline asm might be useful too. Yea. I'm assuming that clobbers still force generation of the address? And presumably we can't model the use of a memory location in the clobber which might argue we need a "uses" argument to asms... Jeff