From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 557 invoked by alias); 7 Dec 2009 03:10:54 -0000 Received: (qmail 547 invoked by uid 22791); 7 Dec 2009 03:10:53 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pw0-f57.google.com (HELO mail-pw0-f57.google.com) (209.85.160.57) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Dec 2009 03:10:47 +0000 Received: by pwi16 with SMTP id 16so173208pwi.16 for ; Sun, 06 Dec 2009 19:10:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.143.154.7 with SMTP id g7mr690626wfo.268.1260155445705; Sun, 06 Dec 2009 19:10:45 -0800 (PST) In-Reply-To: <4B1A87E5.1040102@redhat.com> References: <121fadb80912020218k6beb60aco49793e999091a747@mail.gmail.com> <121fadb80912020429w529cd9c5sd5c6db3f45f823f0@mail.gmail.com> <4B16A54D.2020600@redhat.com> <121fadb80912032301p6026675awc0168a8692087670@mail.gmail.com> <121fadb80912050001l6207eb45qb3ee83f9013ca8a1@mail.gmail.com> <4B1A87E5.1040102@redhat.com> Date: Mon, 07 Dec 2009 03:10:00 -0000 Message-ID: <121fadb80912061910j59436c4en546e6eda7ee614fe@mail.gmail.com> Subject: Re: Insn missing in Size optimization(-Os) From: daniel tian To: Jeff Law Cc: gcc@gcc.gnu.org, peng.zheng@mavrixtech.com, yan.hu@mavrixtech.com.cn Content-Type: text/plain; charset=ISO-8859-1 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-12/txt/msg00081.txt.bz2 > > You might start by monitoring emit_reload_insns's behavior when it handles > your insn. I just debug the source code with your advice. Check the function emit_reload_insns. That insn was deleted before entering funcion emit_reload_insns. It was deleted in reload(...) in reload1.c file just before calling function reload_as_needed(this function will call emit_reload_insns). It is sure that the insn is generated, but deleted after reload. insn was deleted in following code. /* If a pseudo has no hard reg, delete the insns that made the equivalence. If that insn didn't set the register (i.e., it copied the register to memory), just delete that insn instead of the equivalencing insn plus anything now dead. If we call delete_dead_insn on that insn, we may delete the insn that actually sets the register if the register dies there and that is incorrect. */ for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++) { if (reg_renumber[i] < 0 && reg_equiv_init[i] != 0) { rtx list; for (list = reg_equiv_init[i]; list; list = XEXP (list, 1)) { rtx equiv_insn = XEXP (list, 0); /* If we already deleted the insn or if it may trap, we can't delete it. The latter case shouldn't happen, but can if an insn has a variable address, gets a REG_EH_REGION note added to it, and then gets converted into a load from a constant address. */ if (NOTE_P (equiv_insn) || can_throw_internal (equiv_insn)) ; else if (reg_set_p (regno_reg_rtx[i], PATTERN (equiv_insn))) delete_dead_insn (equiv_insn); ---->>>>>>>> Call this function to delete insn. else SET_INSN_DELETED (equiv_insn); } } } I don't know where the reg_equiv_init[i], reg_renumber[i] exactly changed. I knew the init reg_renumber array is to be -1. where those arrays' value changed and by what criteria. I mean I don't know where the gcc thinks this insn is dead, and why dead. Thanks for your advice.