aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoern Rennecke <joern.rennecke@embecosm.com>2013-07-24 20:12:49 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2013-07-24 21:12:49 +0100
commitce4a94223ea08c13ba644b2f8c2dde8a2b1511fb (patch)
treec672dee8f414becb468719cea9403139841a25d1
parentf1e18725591f12da43d0bb1a6ff93de9ee08b059 (diff)
downloadgcc-ce4a94223ea08c13ba644b2f8c2dde8a2b1511fb.zip
gcc-ce4a94223ea08c13ba644b2f8c2dde8a2b1511fb.tar.gz
gcc-ce4a94223ea08c13ba644b2f8c2dde8a2b1511fb.tar.bz2
re PR rtl-optimization/57968 (MODE_EXIT switches inserted too early)
PR rtl-optimization/57968 * mode-switching.c (create_pre_exit): Allow instructions that don't set a return register to need a non-exit mode. From-SVN: r201225
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/mode-switching.c15
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 11a4830..0277054 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2013-07-24 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ PR rtl-optimization/57968
+ * mode-switching.c (create_pre_exit): Allow instructions that
+ don't set a return register to need a non-exit mode.
+
2013-07-24 Bill Schmidt <wschmidt@vnet.linux.ibm.com>
Anton Blanchard <anton@au1.ibm.com>
diff --git a/gcc/mode-switching.c b/gcc/mode-switching.c
index 70a77d0..8ea8ca3 100644
--- a/gcc/mode-switching.c
+++ b/gcc/mode-switching.c
@@ -330,12 +330,10 @@ create_pre_exit (int n_entities, int *entity_map, const int *num_modes)
break;
}
if (!targetm.calls.function_value_regno_p (copy_start))
- {
- last_insn = return_copy;
- continue;
- }
- copy_num
- = hard_regno_nregs[copy_start][GET_MODE (copy_reg)];
+ copy_num = 0;
+ else
+ copy_num
+ = hard_regno_nregs[copy_start][GET_MODE (copy_reg)];
/* If the return register is not likely spilled, - as is
the case for floating point on SH4 - then it might
@@ -372,6 +370,11 @@ create_pre_exit (int n_entities, int *entity_map, const int *num_modes)
forced_late_switch = 1;
break;
}
+ if (copy_num == 0)
+ {
+ last_insn = return_copy;
+ continue;
+ }
if (copy_start >= ret_start
&& copy_start + copy_num <= ret_end)