public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@porcupine.cygnus.com>
To: tm <tm@mail.kloo.net>
Cc: kkojima@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: PATCH: reorg branch displacement fix
Date: Sun, 03 Nov 2002 12:34:00 -0000	[thread overview]
Message-ID: <200211032045.gA3Kj58J003077@porcupine.cygnus.com> (raw)
In-Reply-To: Your message of "Fri, 01 Nov 2002 11:29:06 PST." <Pine.LNX.4.21.0211011127060.4789-100000@mail.kloo.net>

In message <Pine.LNX.4.21.0211011127060.4789-100000@mail.kloo.net>, tm writes:
 >On Fri, 1 Nov 2002, Jeff Law wrote:
 >
 >> In message <Pine.LNX.4.21.0210311508160.3016-100000@mail.kloo.net>, tm writ
 >es:
 >>  >
 >>  >This fixes the problem mentioned in:
 >>  >
 >>  >http://gcc.gnu.org/ml/gcc-bugs/2002-06/msg00896.html
 >>  >
 >>  >When a conditional branch jumps to an unconditional branch, reorg will
 >>  >thread the branch without checking if the conditional branch has enough
 >>  >displacement bits to branch to the target.
 >>  >
 >>  >This patch uses MD_CAN_REDIRECT_BRANCH (as suggested by Joern in followup
 >>  >messages to original message) to implement the substitution checking.
 >>  >
 >>  >Please review and if correct, commit as I don't have CVS access.
 >>  >
 >>  >Toshi
 >>  >
 >>  >Thu Oct 31  Toshiyasu Morita  <toshiyasu.morita@hsa.hitachi.com>
 >>  >
 >>  >	* reorg.c (relax_delay_slots): Don't thread conditional jump
 >>  >        through unconditional jump if the conditional jump can't reach
 >>  >        the branch target on this processor target.
 >> This is wrong.  reorg does not and should not be checking branch displaceme
 >nts.
 >> That is a problem for shorten-branches and the backend.
 >> 
 >> jeff
 >
 >Aha! I see now. I will try disabling that chunk of code, and testing.
 >
 >Incidentially, MD_CAN_REDIRECT_BRANCH is already used in reorg in one
 >other place, in steal_delay_list_from_target():
 >
 >#ifdef MD_CAN_REDIRECT_BRANCH
 >  /* On some targets, branches with delay slots can have a limited
 >     displacement.  Give the back end a chance to tell us we can't do
 >     this.  */
 >  if (! MD_CAN_REDIRECT_BRANCH (insn, XVECEXP (seq, 0, 0)))
 >    return delay_list;
 >#endif
 >
 >This should probably be fixed as well.
Yup.  That code never should have gone into reorg.  It't counter to one of
the fundamental design decisions we made when creating the reorg pass.

jeff

  reply	other threads:[~2002-11-03 20:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-31 15:25 tm
2002-11-01  6:34 ` Jeff Law
2002-11-01 11:35   ` tm
2002-11-03 12:34     ` Jeff Law [this message]
2002-11-01 14:55   ` tm
2002-11-01 15:07     ` Jeff Law
2002-11-01 14:13 Joern Rennecke
2002-11-01 14:49 ` Jeff Law
2002-11-01 14:52   ` tm
2002-11-01 15:21   ` Joern Rennecke
2002-11-01 15:37     ` Jeff Law
2002-11-01 14:51 ` tm
2002-11-01 15:05   ` Jeff Law
2002-11-04 15:16     ` Joern Rennecke
2002-11-04 17:40       ` Hans-Peter Nilsson
2002-11-05 11:45 ` tm
2002-11-06 12:18   ` Joern Rennecke

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=200211032045.gA3Kj58J003077@porcupine.cygnus.com \
    --to=law@porcupine.cygnus.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kkojima@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=tm@mail.kloo.net \
    /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).