summaryrefslogtreecommitdiff
path: root/gcc/mode-switching.c
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-01 18:30:29 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-01 18:30:29 +0000
commitaadec354961a3147095f081a784679e45aaa19f4 (patch)
treefa29950db4e13bd00431984eaf6e64a3fd9e0d45 /gcc/mode-switching.c
parent6e353f72c59c2731451bc416640c6e753c473436 (diff)
downloadgcc-aadec354961a3147095f081a784679e45aaa19f4.tar.gz
* mode-switching.c (optimize_mode_switching): Fix bug in MODE_AFTER
handling. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177068 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/mode-switching.c')
-rw-r--r--gcc/mode-switching.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/mode-switching.c b/gcc/mode-switching.c
index 9b11842781c..7ea241cea7b 100644
--- a/gcc/mode-switching.c
+++ b/gcc/mode-switching.c
@@ -499,6 +499,7 @@ optimize_mode_switching (void)
{
struct seginfo *ptr;
int last_mode = no_mode;
+ bool any_set_required = false;
HARD_REG_SET live_now;
REG_SET_TO_HARD_REG_SET (live_now, df_get_live_in (bb));
@@ -527,6 +528,7 @@ optimize_mode_switching (void)
if (mode != no_mode && mode != last_mode)
{
+ any_set_required = true;
last_mode = mode;
ptr = new_seginfo (mode, insn, bb->index, live_now);
add_seginfo (info + bb->index, ptr);
@@ -548,8 +550,10 @@ optimize_mode_switching (void)
}
info[bb->index].computing = last_mode;
- /* Check for blocks without ANY mode requirements. */
- if (last_mode == no_mode)
+ /* Check for blocks without ANY mode requirements.
+ 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);
add_seginfo (info + bb->index, ptr);