public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kkojima at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/28764] [4.2 Regression] libjava build failure on sh4
Date: Wed, 23 Aug 2006 04:35:00 -0000	[thread overview]
Message-ID: <20060823043524.29884.qmail@sourceware.org> (raw)
In-Reply-To: <bug-28764-5208@http.gcc.gnu.org/bugzilla/>



------- Comment #3 from kkojima at gcc dot gnu dot org  2006-08-23 04:35 -------
Here is a workaround.  Although it doesn't solve the issue
completely, it'd be better than nothing.  It prevents to
insert the mode switching code after the last insn of BB
when that insn has the REG_EH_REGION note.  It also checks
if the last insn needs a mode which doesn't match with
the mode given by the mode switching code in such case.

diff -uprN ORIG/trunk/gcc/mode-switching.c LOCAL/trunk/gcc/mode-switching.c
--- ORIG/trunk/gcc/mode-switching.c     2006-03-09 15:11:37.000000000 +0900
+++ LOCAL/trunk/gcc/mode-switching.c    2006-08-22 09:55:23.000000000 +0900
@@ -612,9 +612,11 @@ optimize_mode_switching (void)
                 of the previous block.  */
              if (eg->flags & EDGE_ABNORMAL)
                {
+                 rtx last = BB_END (src_bb);
+
                  emited = true;
-                 if (JUMP_P (BB_END (src_bb)))
-                   emit_insn_before (mode_set, BB_END (src_bb));
+                 if (JUMP_P (last))
+                   emit_insn_before (mode_set, last);
                  else
                    {
                      /* It doesn't make sense to switch to normal
@@ -629,8 +631,19 @@ optimize_mode_switching (void)
                         sense, anyway).  In the case of EH edges, EH
                         entry points also start in normal mode, so a
                         similar reasoning applies.  */
-                     gcc_assert (NONJUMP_INSN_P (BB_END (src_bb)));
-                     emit_insn_after (mode_set, BB_END (src_bb));
+                     gcc_assert (NONJUMP_INSN_P (last));
+                     /* We cannot insert instructions after the insn
+                        having a REG_EH_REGION note.  */
+                     if (find_reg_note (last, REG_EH_REGION, NULL_RTX))
+                       {
+                         gcc_assert ((MODE_NEEDED (entity_map[j], last)
+                                      == no_mode)
+                                     || (MODE_NEEDED (entity_map[j], last)
+                                         == mode));
+                         emit_insn_before (mode_set, last);
+                       }
+                     else
+                       emit_insn_after (mode_set, last);
                    }
                  bb_info[j][src_bb->index].computing = mode;
                  RESET_BIT (transp[src_bb->index], j);


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28764


  parent reply	other threads:[~2006-08-23  4:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-18  0:23 [Bug rtl-optimization/28764] New: " kkojima at gcc dot gnu dot org
2006-08-18  4:25 ` [Bug target/28764] [4.2 Regression] " pinskia at gcc dot gnu dot org
2006-08-20 22:50 ` mmitchel at gcc dot gnu dot org
2006-08-23  4:35 ` kkojima at gcc dot gnu dot org [this message]
2006-08-23 15:20 ` amylaar at gcc dot gnu dot org
2006-08-23 23:54 ` kkojima at gcc dot gnu dot org
2006-08-24 15:32 ` amylaar at gcc dot gnu dot org
2006-08-24 16:22 ` amylaar at gcc dot gnu dot org
2006-08-25 10:56 ` kkojima at gcc dot gnu dot org
2006-08-25 11:07 ` amylaar at gcc dot gnu dot org
2006-08-25 11:25 ` kkojima at gcc dot gnu dot org
2006-08-25 13:44 ` bonzini at gnu dot org
2006-08-25 14:33 ` amylaar at gcc dot gnu dot org
2006-08-25 16:34 ` amylaar at gcc dot gnu dot org
2006-08-25 16:36 ` bonzini at gnu dot org
2006-08-25 17:01 ` amylaar at gcc dot gnu dot org
2006-09-05 21:41 ` kkojima at gcc dot gnu dot org
2006-09-06  6:14 ` pinskia at gcc dot gnu dot org
2006-12-23 21:25 ` ubizjak at gmail dot com

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=20060823043524.29884.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).