public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: daniel tian <daniel.xntian@gmail.com>
To: Jeff Law <law@redhat.com>
Cc: gcc@gcc.gnu.org, peng.zheng@mavrixtech.com, yan.hu@mavrixtech.com.cn
Subject: Re: Insn missing in Size optimization(-Os)
Date: Mon, 07 Dec 2009 03:10:00 -0000	[thread overview]
Message-ID: <121fadb80912061910j59436c4en546e6eda7ee614fe@mail.gmail.com> (raw)
In-Reply-To: <4B1A87E5.1040102@redhat.com>

>
> 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.

  reply	other threads:[~2009-12-07  3:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-02 10:18 daniel tian
2009-12-02 12:29 ` daniel tian
2009-12-02 16:21   ` Ian Lance Taylor
2009-12-02 17:35   ` Jeff Law
2009-12-04  7:01     ` daniel tian
2009-12-05  8:01       ` daniel tian
2009-12-05 16:18         ` Jeff Law
2009-12-07  3:10           ` daniel tian [this message]
2009-12-08  4:04             ` Jeff Law
2009-12-08  6:11               ` daniel tian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=121fadb80912061910j59436c4en546e6eda7ee614fe@mail.gmail.com \
    --to=daniel.xntian@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=peng.zheng@mavrixtech.com \
    --cc=yan.hu@mavrixtech.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).