From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7293 invoked by alias); 26 Feb 2002 19:27:53 -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 7233 invoked from network); 26 Feb 2002 19:27:47 -0000 Received: from unknown (HELO mx1.mail.ru) (194.67.57.11) by sources.redhat.com with SMTP; 26 Feb 2002 19:27:47 -0000 Received: from [194.105.215.6] (helo=wild.spek.ru) by mx1.mail.ru with smtp (Exim 3.14 #1) id 16fnGI-000CzM-00; Tue, 26 Feb 2002 22:27:42 +0300 Date: Tue, 26 Feb 2002 11:41:00 -0000 From: Dimmy To: Richard Henderson Cc: gcc@gcc.gnu.org Subject: Re: how to force reloader(?) to respect clobber directive? Message-Id: <20020226232259.3189ab27.diwil@mail.ru> In-Reply-To: <20020226094456.A28494@redhat.com> References: <20020226121343.27800870.diwil@eis.ru> <20020226094456.A28494@redhat.com> X-Mailer: Sylpheed version 0.7.0 (GTK+ 1.2.10; i386-unknown-freebsd4.3) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2002-02/txt/msg01609.txt.bz2 Thanks Richard, "+r" did not help much. Actually, I transform a condition code of the insn followed by. So, for the code given: long foo(long a, long b) { if(a>0) goto ee; return a; ee: return b; } gcc wants to use LE condition code. Whithin tstsi operation I'm setting cond code for the next insn to LT. Then I get: ('a' being passed in r14,r15, 'b' - in r12,r13; returns in r14,r15) ---------------- aa: /* prologue: frame size = 0 */ .L__FrameSize_aa=0x0 /* prologue end (size=0) */ /* UID:11 ** ADDR:0 ** COST:16 * (insn:QI 11 34 12 (parallel[ (set (cc0) (reg/v:SI 14 r14 [22])) (clobber (reg/v:SI 14 r14 [22])) ] ) 19 {tstsi} (insn_list 4 (nil)) (expr_list:REG_DEAD (reg/v:SI 14 r14 [22]) (nil))) *****************/ sub #1, r14 ; 11 tstsi [length = 2] subc #0, r15 /* UID:12 ** ADDR:2 ** COST:26 * (jump_insn 12 11 22 (set (pc) (if_then_else (lt (cc0) (const_int 0 [0x0])) (label_ref 32) (pc))) 132 {blt} (nil) (expr_list:REG_BR_PROB (const_int 3999 [0xf9f]) (nil))) *****************/ jl .L1 ; .L1 ; 12 blt [length = 2] .L3: /* UID:26 ** ADDR:4 ** COST:4 * (insn 26 35 32 (set (reg/i:SI 14 r14) (reg/v:SI 12 r12 [23])) 48 {*movsi3} (nil) (expr_list:REG_DEAD (reg/v:SI 12 r12 [23]) (nil))) *****************/ mov r12, r14 ; 26 *movsi3 [length = 2] mov r13, r15 .L1: /* epilogue: frame size=0 */ ret /* epilogue end (size=1) */ /* function aa size 7 (6) */ .Lfe1: .size aa,.Lfe1-aa ---------------- So, as follows from the RTL dump reg:SI 14 dead, but gcc uses it as return operand. Did I miss something here? On Tue, 26 Feb 2002 09:44:56 -0800 Richard Henderson wrote: > On Tue, Feb 26, 2002 at 12:13:43PM +0300, Dmitry wrote: > > (define_insn "tstsi" > > [(set (cc0) (match_operand:SI 0 "register_operand" "r")) > > (clobber (match_dup 0))] > > The constraint must be "+r" in this case. > > > r~ >