From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16576 invoked by alias); 15 Oct 2004 04:25:06 -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 16557 invoked from network); 15 Oct 2004 04:25:05 -0000 Received: from unknown (HELO mail.kloo.net) (63.192.214.25) by sourceware.org with SMTP; 15 Oct 2004 04:25:05 -0000 Received: by mail.kloo.net (Postfix, from userid 504) id 28E343B0228; Thu, 14 Oct 2004 21:11:15 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.kloo.net (Postfix) with ESMTP id 270453B4545; Thu, 14 Oct 2004 21:11:15 -0700 (PDT) Date: Fri, 15 Oct 2004 10:56:00 -0000 From: To: kkojima@rr.iij4i.or.jp, naveens@noida.hcltech.com Cc: gcc@gcc.gnu.org Subject: PR target/16482: first scheduling pass on SH4 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2004-10/txt/msg00600.txt.bz2 Sorry, deleted the original message to which I should be replying, which screws up the threading, but anyway: Original message: http://gcc.gnu.org/ml/gcc/2004-10/msg00176.html Kaz Kojima wrote: > Thus the first insn scheduling permutes [r4+r161]=r164 into a lifetime > of R0 and the spill process needs R0 for the expression for [r4+r161] > because SH-4 uses R0 as the base register for the addressing mode with > an index register. > > Does the first insn scheduling for SH-4 take account of such insn which > uses R0 implicitly? Or is it a problem of the reload pass? The first instruction scheduling pass cannot extend the lifetime of pseudos which need r0 since there is only one r0 register. So yes, this sounds like an SH first instruction scheduling pass bug. Incidentally, I can reproduce the same problem with a small array index and -fPIC. Compile this with -O2 -mf -fPIC: int glob1; adrreg01limm1_set (float *p0) { p0[10] = (float) glob1; } test2.c: In function 'adrreg01limm1_set': test2.c:7: error: unable to find a register to spill in class 'R0_REGS' test2.c:7: error: this is the insn: (insn 49 50 18 0 (set (reg/f:SI 1 r1 [162]) (mem/u:SI (plus:SI (reg:SI 12 r12) (reg/f:SI 1 r1 [163])) [0 S4 A32])) 129 {movsi_ie} (nil) (expr_list:REG_DEAD (reg/f:SI 1 r1 [163]) (expr_list:REG_EQUIV (symbol_ref:SI ("glob1") ) (nil)))) test2.c:7: internal compiler error: in spill_failure, at /reload1.c:1881 Toshi