From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3106 invoked by alias); 2 Dec 2009 17:35:24 -0000 Received: (qmail 3096 invoked by uid 22791); 2 Dec 2009 17:35:23 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Dec 2009 17:35:12 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB2HZBSZ026789 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 2 Dec 2009 12:35:11 -0500 Received: from [172.17.72.2] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB2HZ9Mo026770; Wed, 2 Dec 2009 12:35:10 -0500 Message-ID: <4B16A54D.2020600@redhat.com> Date: Wed, 02 Dec 2009 17:35:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Thunderbird/3.0b4 MIME-Version: 1.0 To: daniel tian CC: gcc@gcc.gnu.org, peng.zheng@mavrixtech.com, yan.hu@mavrixtech.com.cn, Dave Korn , Ian Lance Taylor Subject: Re: Insn missing in Size optimization(-Os) References: <121fadb80912020218k6beb60aco49793e999091a747@mail.gmail.com> <121fadb80912020429w529cd9c5sd5c6db3f45f823f0@mail.gmail.com> In-Reply-To: <121fadb80912020429w529cd9c5sd5c6db3f45f823f0@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg00021.txt.bz2 On 12/02/09 05:29, daniel tian wrote: > Hi, > Addition information, I just found. It was deleted in function: void > set_insn_deleted (rtx insn), in emit-rtl.c. > It is called by reload() in reload1.c. > Here is the code in reload(): > > /* 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); > else > SET_INSN_DELETED (equiv_insn); > } > } > } > > But I don't know why the pseudo register can not be fit into a hard > register. The insn : > > (insn:HI 8 6 11 2 movebug.c:12 (set (reg/f:SI 42) > (symbol_ref:SI ("fun") [flags 0x3] fun>)) 15 {symbolic_address_load} (expr_list:REG_EQUIV (symbol_ref:SI > ("fun") [flags 0x3]) > (nil))) > > is obvious a very useful insn, not a dead one. > When a pseudo which has an equivalent form (via the REG_EQUIV note) fails to get a hard register, reload deletes the insn which sets the pseudo and instead will reload the equivalent form into a suitable hard register prior to use points. What you want to do is look at the reloads generated for insn #9. I'd hazard a guess one of them loaded the value (symbol_ref ("fun")) into R0. Then for some reason (you'll have to figure that out), the reload insn which sets R0 was deleted (or possibly doesn't get emitted because reload thought it was unncessary). jeff