Commit a44250f4 by Joern Rennecke Committed by Joern Rennecke

mode-switching.c (optimize_mode_switching): Fix bug in MODE_AFTER handling.

        * mode-switching.c (optimize_mode_switching): Fix bug in MODE_AFTER
        handling.

From-SVN: r177068
parent efd7630c
2011-08-01 Joern Rennecke <joern.rennecke@embecosm.com>
* mode-switching.c (optimize_mode_switching): Fix bug in MODE_AFTER
handling.
2011-08-01 H.J. Lu <hongjiu.lu@intel.com> 2011-08-01 H.J. Lu <hongjiu.lu@intel.com>
PR target/47766 PR target/47766
......
...@@ -499,6 +499,7 @@ optimize_mode_switching (void) ...@@ -499,6 +499,7 @@ optimize_mode_switching (void)
{ {
struct seginfo *ptr; struct seginfo *ptr;
int last_mode = no_mode; int last_mode = no_mode;
bool any_set_required = false;
HARD_REG_SET live_now; HARD_REG_SET live_now;
REG_SET_TO_HARD_REG_SET (live_now, df_get_live_in (bb)); REG_SET_TO_HARD_REG_SET (live_now, df_get_live_in (bb));
...@@ -527,6 +528,7 @@ optimize_mode_switching (void) ...@@ -527,6 +528,7 @@ optimize_mode_switching (void)
if (mode != no_mode && mode != last_mode) if (mode != no_mode && mode != last_mode)
{ {
any_set_required = true;
last_mode = mode; last_mode = mode;
ptr = new_seginfo (mode, insn, bb->index, live_now); ptr = new_seginfo (mode, insn, bb->index, live_now);
add_seginfo (info + bb->index, ptr); add_seginfo (info + bb->index, ptr);
...@@ -548,8 +550,10 @@ optimize_mode_switching (void) ...@@ -548,8 +550,10 @@ optimize_mode_switching (void)
} }
info[bb->index].computing = last_mode; info[bb->index].computing = last_mode;
/* Check for blocks without ANY mode requirements. */ /* Check for blocks without ANY mode requirements.
if (last_mode == no_mode) N.B. because of MODE_AFTER, last_mode might still be different
from no_mode. */
if (!any_set_required)
{ {
ptr = new_seginfo (no_mode, BB_END (bb), bb->index, live_now); ptr = new_seginfo (no_mode, BB_END (bb), bb->index, live_now);
add_seginfo (info + bb->index, ptr); add_seginfo (info + bb->index, ptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment