summaryrefslogtreecommitdiff
path: root/gcc/config/sh
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-16 01:47:58 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-16 01:47:58 +0000
commit8370b483d36930e46d3ec5a083702386af597654 (patch)
treec3abfe3ff9a4df7e1545b739c0a7409c09cd6b2d /gcc/config/sh
parent8f7323c5912412fdde781a7667fbf60046592218 (diff)
parent6ca03b4e86cec2ebd2b61425871730a8e0cd5df9 (diff)
downloadgcc-8370b483d36930e46d3ec5a083702386af597654.tar.gz
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@204895 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sh')
-rw-r--r--gcc/config/sh/sh.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 215d4cec6e5..0be07b86dab 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "ggc.h"
#include "gimple.h"
+#include "gimplify.h"
#include "cfgloop.h"
#include "alloc-pool.h"
#include "tm-constrs.h"
@@ -5774,24 +5775,21 @@ fixup_addr_diff_vecs (rtx first)
int
barrier_align (rtx barrier_or_label)
{
- rtx next = next_active_insn (barrier_or_label), pat, prev;
+ rtx next, pat;
- if (! next)
+ if (! barrier_or_label)
return 0;
- pat = PATTERN (next);
-
- if (GET_CODE (pat) == ADDR_DIFF_VEC)
+ if (LABEL_P (barrier_or_label)
+ && NEXT_INSN (barrier_or_label)
+ && JUMP_TABLE_DATA_P (NEXT_INSN (barrier_or_label)))
return 2;
- if (GET_CODE (pat) == UNSPEC_VOLATILE && XINT (pat, 1) == UNSPECV_ALIGN)
- /* This is a barrier in front of a constant table. */
- return 0;
-
- prev = prev_active_insn (barrier_or_label);
- if (GET_CODE (PATTERN (prev)) == ADDR_DIFF_VEC)
+ if (BARRIER_P (barrier_or_label)
+ && PREV_INSN (barrier_or_label)
+ && JUMP_TABLE_DATA_P (PREV_INSN (barrier_or_label)))
{
- pat = PATTERN (prev);
+ pat = PATTERN (PREV_INSN (barrier_or_label));
/* If this is a very small table, we want to keep the alignment after
the table to the minimum for proper code alignment. */
return ((optimize_size
@@ -5800,6 +5798,17 @@ barrier_align (rtx barrier_or_label)
? 1 << TARGET_SHMEDIA : align_jumps_log);
}
+ next = next_active_insn (barrier_or_label);
+
+ if (! next)
+ return 0;
+
+ pat = PATTERN (next);
+
+ if (GET_CODE (pat) == UNSPEC_VOLATILE && XINT (pat, 1) == UNSPECV_ALIGN)
+ /* This is a barrier in front of a constant table. */
+ return 0;
+
if (optimize_size)
return 0;
@@ -5824,13 +5833,12 @@ barrier_align (rtx barrier_or_label)
(fill_eager_delay_slots) and the branch is to the insn after the insn
after the barrier. */
- /* PREV is presumed to be the JUMP_INSN for the barrier under
- investigation. Skip to the insn before it. */
-
int slot, credit;
bool jump_to_next = false;
- prev = prev_real_insn (prev);
+ /* Skip to the insn before the JUMP_INSN before the barrier under
+ investigation. */
+ rtx prev = prev_real_insn (prev_active_insn (barrier_or_label));
for (slot = 2, credit = (1 << (CACHE_LOG - 2)) + 2;
credit >= 0 && prev && NONJUMP_INSN_P (prev);