public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: Richard Henderson <rth@redhat.com>
Cc: "H.J. Lu" <hjl.tools@gmail.com>,
	gcc-patches@gcc.gnu.org, 	Jan Hubicka <hubicka@ucw.cz>
Subject: Re: PATCH: Properly check the end of basic block
Date: Fri, 19 Nov 2010 01:15:00 -0000	[thread overview]
Message-ID: <AANLkTi=dds4BLXzFxZKXH2BBQzyJhBX4nnGKa55qoNcz@mail.gmail.com> (raw)
In-Reply-To: <4CE5B229.3010403@redhat.com>

On Fri, Nov 19, 2010 at 12:09 AM, Richard Henderson <rth@redhat.com> wrote:
> On 11/18/2010 02:50 PM, Uros Bizjak wrote:
>> -       emit_jump_insn_before (gen_return_internal_long (), ret);
>> +       /* We have to update BB_END (bb) here - delete_insn will
>> +          not do it automatically since CFG is not available in
>> +          machine_reorg pass.  */
>> +       BB_END (bb)
>> +         = emit_jump_insn_before (gen_return_internal_long (), ret);
>
> While that by itself is fine, calling compute_bb_for_insn at the
> beginning of md_reorg will make sure that things stay up-to-date
> for any other changes that are being made within that function.
>
> I.e. compute_bb_for_insn seems safer overall.

Thanks,

attached patch adds x86 as a 10th member to an unhappy family of
targets that are crippled by a compatibility requirements...

2010-11-19  Uros Bizjak  <ubizjak@gmail.com>

	PR target/46546
	* config/i386/i386.c (ix86_reorg): Call compute_bb_for_insn.

Bootstrapped on x86_64-pc-linux-gnu {,32}, will commit to mainline
once regression test ends.

Uros.

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 166920)
+++ config/i386/i386.c	(working copy)
@@ -29765,6 +29765,10 @@ ix86_pad_short_function (void)
 static void
 ix86_reorg (void)
 {
+  /* We are freeing block_for_insn in the toplev to keep compatibility
+     with old MDEP_REORGS that are not CFG based.  Recompute it now.  */
+  compute_bb_for_insn ();
+
   if (optimize && optimize_function_for_speed_p (cfun))
     {
       if (TARGET_PAD_SHORT_FUNCTION)

  reply	other threads:[~2010-11-18 23:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17  8:34 H.J. Lu
2010-11-17  9:24 ` Uros Bizjak
2010-11-17 15:21   ` H.J. Lu
2010-11-17 20:26     ` Uros Bizjak
2010-11-18  0:49       ` H.J. Lu
2010-11-18  7:06         ` H.J. Lu
2010-11-18  9:23         ` Uros Bizjak
2010-11-18 10:47         ` Uros Bizjak
2010-11-18 18:38   ` H.J. Lu
2010-11-18 19:27     ` Uros Bizjak
2010-11-18 19:51       ` H.J. Lu
2010-11-18 20:25         ` Uros Bizjak
2010-11-18 20:44           ` H.J. Lu
2010-11-18 22:30           ` Uros Bizjak
2010-11-18 22:33             ` Andrew Pinski
2010-11-18 22:36             ` Jakub Jelinek
2010-11-18 22:55               ` Uros Bizjak
2010-11-18 22:50             ` Richard Henderson
2010-11-18 23:48               ` Uros Bizjak
2010-11-19  0:56                 ` Richard Henderson
2010-11-19  1:15                   ` Uros Bizjak [this message]
2010-11-19  9:56             ` Jan Hubicka
2010-11-18 23:09 Steven Bosscher
2010-11-18 23:37 ` Uros Bizjak
2010-11-23 12:42 ` Richard Sandiford
2010-11-23 13:28   ` Steven Bosscher

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='AANLkTi=dds4BLXzFxZKXH2BBQzyJhBX4nnGKa55qoNcz@mail.gmail.com' \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=hubicka@ucw.cz \
    --cc=rth@redhat.com \
    /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).