summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-29 12:11:10 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-29 12:11:10 +0000
commit77985f1a1eee0690b7d2a564339c63e6eadd1900 (patch)
tree8230af9f599ea90460f26ce09380d6f167c3704d
parent78e8d5ffbf0ba5031b736d2c6fc6a44605047cbc (diff)
downloadlinaro-gcc-77985f1a1eee0690b7d2a564339c63e6eadd1900.tar.gz
linaro-gcc-77985f1a1eee0690b7d2a564339c63e6eadd1900.tar.bz2
linaro-gcc-77985f1a1eee0690b7d2a564339c63e6eadd1900.zip
* cfgbuild.c (inside_basic_block_p): Use JUMP_TABLE_DATA_P in lieu
of tests for JUMP_P and a ADDR_DIFF_VEC or ADDR_VEC pattern. (control_flow_insn_p): Likewise. * cfgrtl.c (duplicate_insn_chain): Likewise. * final.c (get_attr_length_1): Likewise. (shorten_branches): Likewise. (final_scan_insn): Likewise. * function.c (instantiate_virtual_regs): Likewise. * gcse.c (insert_insn_end_basic_block): Likewise. * ira-costs.c (scan_one_insn): Likewise. * lra-eliminations.c (eliminate_regs_in_insn): Likewise. * lra.c (check_rtl): Likewise. * reload1.c (elimination_costs_in_insn): Likewise. * reorg.c (follow_jumps): Likewise. * config/arm/arm.c (is_jump_table): Use JUMP_TABLE_DATA_P in lieu of tests for JUMP_P and a ADDR_DIFF_VEC or ADDR_VEC pattern. (thumb_far_jump_used_p): Likewise. * config/bfin/bfin.c (workaround_rts_anomaly): Likewise. (workaround_speculation): Likewise. (add_sched_insns_for_speculation): Likewise. * config/c6x/c6x.c (reorg_emit_nops): Likewise. * config/frv/frv.c (frv_function_contains_far_jump): Likewise. (frv_for_each_packet): Likewise. * config/i386/i386.c (ix86_avoid_jump_mispredicts): Likewise. * config/ia64/ia64.c (emit_all_insn_group_barriers): Likewise. (final_emit_insn_group_barriers): Likewise. * config/m32r/m32r.c (m32r_is_insn): Likewise. * config/mips/mips.c (USEFUL_INSN_P): Likewise. (mips16_insn_length): Likewise. * config/pa/pa.c (pa_reorg): Likewise. (pa_combine_instructions): Likewise. * config/rs6000/rs6000.c (rs6000_invalid_within_doloop): Likewise. * config/sh/sh.c (fixup_addr_diff_vecs): Likewise. (sh_reorg): Likewise. (split_branches): Likewise. * config/spu/spu.c (get_branch_target): Likewise. * config/s390/s390.c (s390_chunkify_start): Simplify logic using JUMP_TABLE_DATA_P. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197234 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog43
-rw-r--r--gcc/cfgbuild.c10
-rw-r--r--gcc/cfgrtl.c3
-rw-r--r--gcc/config/arm/arm.c7
-rw-r--r--gcc/config/bfin/bfin.c25
-rw-r--r--gcc/config/c6x/c6x.c4
-rw-r--r--gcc/config/frv/frv.c7
-rw-r--r--gcc/config/i386/i386.c9
-rw-r--r--gcc/config/ia64/ia64.c6
-rw-r--r--gcc/config/m32r/m32r.c4
-rw-r--r--gcc/config/mips/mips.c9
-rw-r--r--gcc/config/pa/pa.c19
-rw-r--r--gcc/config/rs6000/rs6000.c4
-rw-r--r--gcc/config/s390/s390.c15
-rw-r--r--gcc/config/sh/sh.c7
-rw-r--r--gcc/config/spu/spu.c3
-rw-r--r--gcc/final.c11
-rw-r--r--gcc/function.c5
-rw-r--r--gcc/gcse.c3
-rw-r--r--gcc/ira-costs.c6
-rw-r--r--gcc/lra-eliminations.c5
-rw-r--r--gcc/lra.c3
-rw-r--r--gcc/reload1.c10
-rw-r--r--gcc/reorg.c4
24 files changed, 116 insertions, 106 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6b9db43ce10..e172f414e5e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,46 @@
+2013-03-29 Steven Bosscher <steven@gcc.gnu.org>
+
+ * cfgbuild.c (inside_basic_block_p): Use JUMP_TABLE_DATA_P in lieu
+ of tests for JUMP_P and a ADDR_DIFF_VEC or ADDR_VEC pattern.
+ (control_flow_insn_p): Likewise.
+ * cfgrtl.c (duplicate_insn_chain): Likewise.
+ * final.c (get_attr_length_1): Likewise.
+ (shorten_branches): Likewise.
+ (final_scan_insn): Likewise.
+ * function.c (instantiate_virtual_regs): Likewise.
+ * gcse.c (insert_insn_end_basic_block): Likewise.
+ * ira-costs.c (scan_one_insn): Likewise.
+ * lra-eliminations.c (eliminate_regs_in_insn): Likewise.
+ * lra.c (check_rtl): Likewise.
+ * reload1.c (elimination_costs_in_insn): Likewise.
+ * reorg.c (follow_jumps): Likewise.
+
+ * config/arm/arm.c (is_jump_table): Use JUMP_TABLE_DATA_P in lieu
+ of tests for JUMP_P and a ADDR_DIFF_VEC or ADDR_VEC pattern.
+ (thumb_far_jump_used_p): Likewise.
+ * config/bfin/bfin.c (workaround_rts_anomaly): Likewise.
+ (workaround_speculation): Likewise.
+ (add_sched_insns_for_speculation): Likewise.
+ * config/c6x/c6x.c (reorg_emit_nops): Likewise.
+ * config/frv/frv.c (frv_function_contains_far_jump): Likewise.
+ (frv_for_each_packet): Likewise.
+ * config/i386/i386.c (ix86_avoid_jump_mispredicts): Likewise.
+ * config/ia64/ia64.c (emit_all_insn_group_barriers): Likewise.
+ (final_emit_insn_group_barriers): Likewise.
+ * config/m32r/m32r.c (m32r_is_insn): Likewise.
+ * config/mips/mips.c (USEFUL_INSN_P): Likewise.
+ (mips16_insn_length): Likewise.
+ * config/pa/pa.c (pa_reorg): Likewise.
+ (pa_combine_instructions): Likewise.
+ * config/rs6000/rs6000.c (rs6000_invalid_within_doloop): Likewise.
+ * config/sh/sh.c (fixup_addr_diff_vecs): Likewise.
+ (sh_reorg): Likewise.
+ (split_branches): Likewise.
+ * config/spu/spu.c (get_branch_target): Likewise.
+
+ * config/s390/s390.c (s390_chunkify_start): Simplify logic using
+ JUMP_TABLE_DATA_P.
+
2013-03-29 Kirill Yukhin <kirill.yukhin@intel.com>
* gcc/config/i386/avx2intrin.h (_mm256_broadcastsi128_si256):
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index c47aad0c12f..34cc29c5685 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -51,13 +51,10 @@ inside_basic_block_p (const_rtx insn)
case CODE_LABEL:
/* Avoid creating of basic block for jumptables. */
return (NEXT_INSN (insn) == 0
- || !JUMP_P (NEXT_INSN (insn))
- || (GET_CODE (PATTERN (NEXT_INSN (insn))) != ADDR_VEC
- && GET_CODE (PATTERN (NEXT_INSN (insn))) != ADDR_DIFF_VEC));
+ || ! JUMP_TABLE_DATA_P (insn));
case JUMP_INSN:
- return (GET_CODE (PATTERN (insn)) != ADDR_VEC
- && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC);
+ return (! JUMP_TABLE_DATA_P (insn));
case CALL_INSN:
case INSN:
@@ -88,8 +85,7 @@ control_flow_insn_p (const_rtx insn)
case JUMP_INSN:
/* Jump insn always causes control transfer except for tablejumps. */
- return (GET_CODE (PATTERN (insn)) != ADDR_VEC
- && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC);
+ return (! JUMP_TABLE_DATA_P (insn));
case CALL_INSN:
/* Noreturn and sibling call instructions terminate the basic blocks
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index ec1ba9ad71c..56ea2a83a61 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -3627,8 +3627,7 @@ duplicate_insn_chain (rtx from, rtx to)
/* Avoid copying of dispatch tables. We never duplicate
tablejumps, so this can hit only in case the table got
moved far from original jump. */
- if (GET_CODE (PATTERN (insn)) == ADDR_VEC
- || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC)
+ if (JUMP_TABLE_DATA_P (insn))
{
/* Avoid copying following barrier as well if any
(and debug insns in between). */
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 5f63a2e8712..17a15989c64 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -12824,9 +12824,7 @@ is_jump_table (rtx insn)
&& ((table = next_real_insn (JUMP_LABEL (insn)))
== next_real_insn (insn))
&& table != NULL
- && JUMP_P (table)
- && (GET_CODE (PATTERN (table)) == ADDR_VEC
- || GET_CODE (PATTERN (table)) == ADDR_DIFF_VEC))
+ && JUMP_TABLE_DATA_P (table))
return table;
return NULL_RTX;
@@ -22658,8 +22656,7 @@ thumb_far_jump_used_p (void)
{
if (JUMP_P (insn)
/* Ignore tablejump patterns. */
- && GET_CODE (PATTERN (insn)) != ADDR_VEC
- && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC
+ && ! JUMP_TABLE_DATA_P (insn)
&& get_attr_far_jump (insn) == FAR_JUMP_YES
)
{
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index a2d22c1c26f..7fab975a673 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -4084,12 +4084,15 @@ workaround_rts_anomaly (void)
if (NOTE_P (insn) || LABEL_P (insn))
continue;
+ if (JUMP_TABLE_DATA_P (insn))
+ continue;
+
if (first_insn == NULL_RTX)
first_insn = insn;
pat = PATTERN (insn);
if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER
- || GET_CODE (pat) == ASM_INPUT || GET_CODE (pat) == ADDR_VEC
- || GET_CODE (pat) == ADDR_DIFF_VEC || asm_noperands (pat) >= 0)
+ || GET_CODE (pat) == ASM_INPUT
+ || asm_noperands (pat) >= 0)
continue;
if (CALL_P (insn))
@@ -4277,6 +4280,8 @@ workaround_speculation (void)
if (NOTE_P (insn) || BARRIER_P (insn))
continue;
+ if (JUMP_TABLE_DATA_P (insn))
+ continue;
if (LABEL_P (insn))
{
@@ -4285,8 +4290,7 @@ workaround_speculation (void)
}
pat = PATTERN (insn);
- if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER
- || GET_CODE (pat) == ADDR_VEC || GET_CODE (pat) == ADDR_DIFF_VEC)
+ if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER)
continue;
if (GET_CODE (pat) == ASM_INPUT || asm_noperands (pat) >= 0)
@@ -4434,10 +4438,13 @@ workaround_speculation (void)
if (NOTE_P (target) || BARRIER_P (target) || LABEL_P (target))
continue;
+ if (JUMP_TABLE_DATA_P (target))
+ continue;
+
pat = PATTERN (target);
if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER
- || GET_CODE (pat) == ASM_INPUT || GET_CODE (pat) == ADDR_VEC
- || GET_CODE (pat) == ADDR_DIFF_VEC || asm_noperands (pat) >= 0)
+ || GET_CODE (pat) == ASM_INPUT
+ || asm_noperands (pat) >= 0)
continue;
if (NONDEBUG_INSN_P (target))
@@ -4510,11 +4517,13 @@ add_sched_insns_for_speculation (void)
if (NOTE_P (insn) || BARRIER_P (insn) || LABEL_P (insn))
continue;
+ if (JUMP_TABLE_DATA_P (insn))
+ continue;
pat = PATTERN (insn);
if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER
- || GET_CODE (pat) == ASM_INPUT || GET_CODE (pat) == ADDR_VEC
- || GET_CODE (pat) == ADDR_DIFF_VEC || asm_noperands (pat) >= 0)
+ || GET_CODE (pat) == ASM_INPUT
+ || asm_noperands (pat) >= 0)
continue;
if (JUMP_P (insn))
diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c
index f66ad55978e..a7c36833b45 100644
--- a/gcc/config/c6x/c6x.c
+++ b/gcc/config/c6x/c6x.c
@@ -5052,9 +5052,7 @@ reorg_emit_nops (rtx *call_labels)
|| GET_CODE (PATTERN (insn)) == USE
|| GET_CODE (PATTERN (insn)) == CLOBBER
|| shadow_or_blockage_p (insn)
- || (JUMP_P (insn)
- && (GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
- || GET_CODE (PATTERN (insn)) == ADDR_VEC)))
+ || JUMP_TABLE_DATA_P (insn))
goto next_insn;
if (!c6x_flag_schedule_insns2)
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index fd5349f218e..ab7502e95d9 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -1410,8 +1410,7 @@ frv_function_contains_far_jump (void)
while (insn != NULL
&& !(JUMP_P (insn)
/* Ignore tablejump patterns. */
- && GET_CODE (PATTERN (insn)) != ADDR_VEC
- && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC
+ && ! JUMP_TABLE_DATA_P (insn)
&& get_attr_far_jump (insn) == FAR_JUMP_YES))
insn = NEXT_INSN (insn);
return (insn != NULL);
@@ -7481,13 +7480,11 @@ frv_for_each_packet (void (*handle_packet) (void))
frv_start_packet_block ();
}
- if (INSN_P (insn))
+ if (INSN_P (insn) && ! JUMP_TABLE_DATA_P (insn))
switch (GET_CODE (PATTERN (insn)))
{
case USE:
case CLOBBER:
- case ADDR_VEC:
- case ADDR_DIFF_VEC:
break;
default:
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 030183c9e0f..732b2a31e8a 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -35209,8 +35209,7 @@ ix86_avoid_jump_mispredicts (void)
{
start = NEXT_INSN (start);
if ((JUMP_P (start)
- && GET_CODE (PATTERN (start)) != ADDR_VEC
- && GET_CODE (PATTERN (start)) != ADDR_DIFF_VEC)
+ && ! JUMP_TABLE_DATA_P (start))
|| CALL_P (start))
njumps--, isjump = 1;
else
@@ -35227,8 +35226,7 @@ ix86_avoid_jump_mispredicts (void)
fprintf (dump_file, "Insn %i estimated to %i bytes\n",
INSN_UID (insn), min_size);
if ((JUMP_P (insn)
- && GET_CODE (PATTERN (insn)) != ADDR_VEC
- && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC)
+ && ! JUMP_TABLE_DATA_P (insn))
|| CALL_P (insn))
njumps++;
else
@@ -35238,8 +35236,7 @@ ix86_avoid_jump_mispredicts (void)
{
start = NEXT_INSN (start);
if ((JUMP_P (start)
- && GET_CODE (PATTERN (start)) != ADDR_VEC
- && GET_CODE (PATTERN (start)) != ADDR_DIFF_VEC)
+ && ! JUMP_TABLE_DATA_P (start))
|| CALL_P (start))
njumps--, isjump = 1;
else
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 0e328ff827b..144cf7ee5ee 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -6987,8 +6987,7 @@ emit_all_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED)
if (! last)
continue;
- if (JUMP_P (last)
- && GET_CODE (PATTERN (last)) == ADDR_DIFF_VEC)
+ if (JUMP_TABLE_DATA_P (last))
last = prev_active_insn (last);
if (recog_memoized (last) != CODE_FOR_insn_group_barrier)
emit_insn_after (gen_insn_group_barrier (GEN_INT (3)), last);
@@ -9376,8 +9375,7 @@ final_emit_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED)
if (! last)
continue;
- if (JUMP_P (last)
- && GET_CODE (PATTERN (last)) == ADDR_DIFF_VEC)
+ if (JUMP_TABLE_DATA_P (last))
last = prev_active_insn (last);
if (recog_memoized (last) != CODE_FOR_insn_group_barrier)
emit_insn_after (gen_insn_group_barrier (GEN_INT (3)), last);
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 8dfce684f24..93df52f79ea 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -1308,9 +1308,9 @@ static int
m32r_is_insn (rtx insn)
{
return (NONDEBUG_INSN_P (insn)
+ && ! JUMP_TABLE_DATA_P (insn)
&& GET_CODE (PATTERN (insn)) != USE
- && GET_CODE (PATTERN (insn)) != CLOBBER
- && GET_CODE (PATTERN (insn)) != ADDR_VEC);
+ && GET_CODE (PATTERN (insn)) != CLOBBER);
}
/* Increase the priority of long instructions so that the
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index d7a0749b4ee..7a67c45c65e 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -95,12 +95,13 @@ along with GCC; see the file COPYING3. If not see
: TARGET_64BIT ? 0x100 : 0x400)
/* True if INSN is a mips.md pattern or asm statement. */
+/* ??? This test exists through the compiler, perhaps it should be
+ moved to rtl.h. */
#define USEFUL_INSN_P(INSN) \
(NONDEBUG_INSN_P (INSN) \
+ && ! JUMP_TABLE_DATA_P (INSN) \
&& GET_CODE (PATTERN (INSN)) != USE \
- && GET_CODE (PATTERN (INSN)) != CLOBBER \
- && GET_CODE (PATTERN (INSN)) != ADDR_VEC \
- && GET_CODE (PATTERN (INSN)) != ADDR_DIFF_VEC)
+ && GET_CODE (PATTERN (INSN)) != CLOBBER)
/* If INSN is a delayed branch sequence, return the first instruction
in the sequence, otherwise return INSN itself. */
@@ -14648,7 +14649,7 @@ mips16_emit_constants (struct mips16_constant *constants, rtx insn)
static int
mips16_insn_length (rtx insn)
{
- if (JUMP_P (insn))
+ if (JUMP_TABLE_DATA_P (insn))
{
rtx body = PATTERN (insn);
if (GET_CODE (body) == ADDR_VEC)
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 1cad695cf0d..b969e108b71 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -8997,9 +8997,7 @@ pa_reorg (void)
unsigned int length, i;
/* Find an ADDR_VEC or ADDR_DIFF_VEC insn to explode. */
- if (! JUMP_P (insn)
- || (GET_CODE (PATTERN (insn)) != ADDR_VEC
- && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC))
+ if (! JUMP_TABLE_DATA_P (insn))
continue;
/* Emit marker for the beginning of the branch table. */
@@ -9056,9 +9054,7 @@ pa_reorg (void)
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
/* Find an ADDR_VEC insn. */
- if (! JUMP_P (insn)
- || (GET_CODE (PATTERN (insn)) != ADDR_VEC
- && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC))
+ if (! JUMP_TABLE_DATA_P (insn))
continue;
/* Now generate markers for the beginning and end of the
@@ -9138,10 +9134,9 @@ pa_combine_instructions (void)
/* We only care about INSNs, JUMP_INSNs, and CALL_INSNs.
Also ignore any special USE insns. */
if ((! NONJUMP_INSN_P (anchor) && ! JUMP_P (anchor) && ! CALL_P (anchor))
+ || JUMP_TABLE_DATA_P (anchor)
|| GET_CODE (PATTERN (anchor)) == USE
- || GET_CODE (PATTERN (anchor)) == CLOBBER
- || GET_CODE (PATTERN (anchor)) == ADDR_VEC
- || GET_CODE (PATTERN (anchor)) == ADDR_DIFF_VEC)
+ || GET_CODE (PATTERN (anchor)) == CLOBBER)
continue;
anchor_attr = get_attr_pa_combine_type (anchor);
@@ -9165,8 +9160,7 @@ pa_combine_instructions (void)
/* Anything except a regular INSN will stop our search. */
if (! NONJUMP_INSN_P (floater)
- || GET_CODE (PATTERN (floater)) == ADDR_VEC
- || GET_CODE (PATTERN (floater)) == ADDR_DIFF_VEC)
+ || JUMP_TABLE_DATA_P (floater))
{
floater = NULL_RTX;
break;
@@ -9227,8 +9221,7 @@ pa_combine_instructions (void)
/* Anything except a regular INSN will stop our search. */
if (! NONJUMP_INSN_P (floater)
- || GET_CODE (PATTERN (floater)) == ADDR_VEC
- || GET_CODE (PATTERN (floater)) == ADDR_DIFF_VEC)
+ || JUMP_TABLE_DATA_P (floater))
{
floater = NULL_RTX;
break;
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 0fe45d8b151..72cf8de83ab 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -18788,9 +18788,7 @@ rs6000_invalid_within_doloop (const_rtx insn)
if (CALL_P (insn))
return "Function call in the loop.";
- if (JUMP_P (insn)
- && (GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
- || GET_CODE (PATTERN (insn)) == ADDR_VEC))
+ if (JUMP_TABLE_DATA_P (insn))
return "Computed branch in the loop.";
return NULL;
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index f6aa581e4b8..ab1e1f50b51 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -5739,7 +5739,7 @@ addr_generation_dependency_p (rtx dep_rtx, rtx insn)
rtx target, pat;
if (NONJUMP_INSN_P (dep_rtx))
- dep_rtx = PATTERN (dep_rtx);
+ dep_rtx = PATTERN (dep_rtx);
if (GET_CODE (dep_rtx) == SET)
{
@@ -7013,11 +7013,7 @@ s390_chunkify_start (void)
&& (LABEL_PRESERVE_P (insn) || LABEL_NAME (insn)))
{
rtx vec_insn = next_real_insn (insn);
- rtx vec_pat = vec_insn && JUMP_P (vec_insn) ?
- PATTERN (vec_insn) : NULL_RTX;
- if (!vec_pat
- || !(GET_CODE (vec_pat) == ADDR_VEC
- || GET_CODE (vec_pat) == ADDR_DIFF_VEC))
+ if (! vec_insn || ! JUMP_TABLE_DATA_P (vec_insn))
bitmap_set_bit (far_labels, CODE_LABEL_NUMBER (insn));
}
@@ -7048,12 +7044,9 @@ s390_chunkify_start (void)
/* Find the jump table used by this casesi jump. */
rtx vec_label = XEXP (XEXP (XVECEXP (pat, 0, 1), 0), 0);
rtx vec_insn = next_real_insn (vec_label);
- rtx vec_pat = vec_insn && JUMP_P (vec_insn) ?
- PATTERN (vec_insn) : NULL_RTX;
- if (vec_pat
- && (GET_CODE (vec_pat) == ADDR_VEC
- || GET_CODE (vec_pat) == ADDR_DIFF_VEC))
+ if (vec_insn && JUMP_TABLE_DATA_P (vec_insn))
{
+ rtx vec_pat = PATTERN (vec_insn);
int i, diff_p = GET_CODE (vec_pat) == ADDR_DIFF_VEC;
for (i = 0; i < XVECLEN (vec_pat, diff_p); i++)
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 44e1e4ce30e..d13198b025b 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -5799,7 +5799,7 @@ fixup_addr_diff_vecs (rtx first)
{
rtx vec_lab, pat, prev, prevpat, x, braf_label;
- if (!JUMP_P (insn)
+ if (! JUMP_TABLE_DATA_P (insn)
|| GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC)
continue;
pat = PATTERN (insn);
@@ -6233,7 +6233,7 @@ sh_reorg (void)
num_mova = 0;
}
}
- else if (JUMP_P (insn)
+ else if (JUMP_TABLE_DATA_P (insn)
&& GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
&& num_mova
/* ??? loop invariant motion can also move a mova out of a
@@ -6496,8 +6496,7 @@ split_branches (rtx first)
}
else if (JUMP_P (insn)
/* Don't mess with ADDR_DIFF_VEC */
- && (GET_CODE (PATTERN (insn)) == SET
- || GET_CODE (PATTERN (insn)) == RETURN))
+ && ! JUMP_TABLE_DATA_P (insn))
{
enum attr_type type = get_attr_type (insn);
if (type == TYPE_CBRANCH)
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 2d8ec9c89b2..ec5a9873421 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -2172,8 +2172,7 @@ get_branch_target (rtx branch)
return gen_rtx_REG (SImode, LINK_REGISTER_REGNUM);
/* jump table */
- if (GET_CODE (PATTERN (branch)) == ADDR_VEC
- || GET_CODE (PATTERN (branch)) == ADDR_DIFF_VEC)
+ if (JUMP_TABLE_DATA_P (branch))
return 0;
/* ASM GOTOs. */
diff --git a/gcc/final.c b/gcc/final.c
index d25b8e0b7e4..577d5ebdca4 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -396,7 +396,7 @@ get_attr_length_1 (rtx insn, int (*fallback_fn) (rtx))
case JUMP_INSN:
body = PATTERN (insn);
- if (GET_CODE (body) == ADDR_VEC || GET_CODE (body) == ADDR_DIFF_VEC)
+ if (JUMP_TABLE_DATA_P (insn))
{
/* Alignment is machine-dependent and should be handled by
ADDR_VEC_ALIGN. */
@@ -1020,7 +1020,7 @@ shorten_branches (rtx first)
int min_align;
addr_diff_vec_flags flags;
- if (!JUMP_P (insn)
+ if (! JUMP_TABLE_DATA_P (insn)
|| GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC)
continue;
pat = PATTERN (insn);
@@ -1094,7 +1094,7 @@ shorten_branches (rtx first)
continue;
body = PATTERN (insn);
- if (GET_CODE (body) == ADDR_VEC || GET_CODE (body) == ADDR_DIFF_VEC)
+ if (JUMP_TABLE_DATA_P (insn))
{
/* This only takes room if read-only data goes into the text
section. */
@@ -1230,7 +1230,8 @@ shorten_branches (rtx first)
INSN_ADDRESSES (uid) = insn_current_address;
#ifdef CASE_VECTOR_SHORTEN_MODE
- if (optimize && JUMP_P (insn)
+ if (optimize
+ && JUMP_TABLE_DATA_P (insn)
&& GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC)
{
rtx body = PATTERN (insn);
@@ -2404,7 +2405,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
/* Detect insns that are really jump-tables
and output them as such. */
- if (GET_CODE (body) == ADDR_VEC || GET_CODE (body) == ADDR_DIFF_VEC)
+ if (JUMP_TABLE_DATA_P (insn))
{
#if !(defined(ASM_OUTPUT_ADDR_VEC) || defined(ASM_OUTPUT_ADDR_DIFF_VEC))
int vlen, idx;
diff --git a/gcc/function.c b/gcc/function.c
index cd9cb855d40..d3b7ed67f7b 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1915,10 +1915,9 @@ instantiate_virtual_regs (void)
{
/* These patterns in the instruction stream can never be recognized.
Fortunately, they shouldn't contain virtual registers either. */
- if (GET_CODE (PATTERN (insn)) == USE
+ if (JUMP_TABLE_DATA_P (insn)
+ || GET_CODE (PATTERN (insn)) == USE
|| GET_CODE (PATTERN (insn)) == CLOBBER
- || GET_CODE (PATTERN (insn)) == ADDR_VEC
- || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
|| GET_CODE (PATTERN (insn)) == ASM_INPUT)
continue;
else if (DEBUG_INSN_P (insn))
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 0c176f69f48..f6bf2fc22a0 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -2155,8 +2155,7 @@ insert_insn_end_basic_block (struct expr *expr, basic_block bb)
/* If this is a jump table, then we can't insert stuff here. Since
we know the previous real insn must be the tablejump, we insert
the new instruction just before the tablejump. */
- if (GET_CODE (PATTERN (insn)) == ADDR_VEC
- || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC)
+ if (JUMP_TABLE_DATA_P (insn))
insn = prev_active_insn (insn);
#ifdef HAVE_cc0
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index 1de006129ed..562aeb0f1bf 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -1269,12 +1269,12 @@ scan_one_insn (rtx insn)
int i, k;
bool counted_mem;
- if (!NONDEBUG_INSN_P (insn))
+ if (!NONDEBUG_INSN_P (insn)
+ || JUMP_TABLE_DATA_P (insn))
return insn;
pat_code = GET_CODE (PATTERN (insn));
- if (pat_code == USE || pat_code == CLOBBER || pat_code == ASM_INPUT
- || pat_code == ADDR_VEC || pat_code == ADDR_DIFF_VEC)
+ if (pat_code == USE || pat_code == CLOBBER || pat_code == ASM_INPUT)
return insn;
counted_mem = false;
diff --git a/gcc/lra-eliminations.c b/gcc/lra-eliminations.c
index 9df0bae54c5..1f88d6bbef7 100644
--- a/gcc/lra-eliminations.c
+++ b/gcc/lra-eliminations.c
@@ -767,10 +767,9 @@ eliminate_regs_in_insn (rtx insn, bool replace_p)
if (icode < 0 && asm_noperands (PATTERN (insn)) < 0 && ! DEBUG_INSN_P (insn))
{
- lra_assert (GET_CODE (PATTERN (insn)) == USE
+ lra_assert (JUMP_TABLE_DATA_P (insn)
+ || GET_CODE (PATTERN (insn)) == USE
|| GET_CODE (PATTERN (insn)) == CLOBBER
- || GET_CODE (PATTERN (insn)) == ADDR_VEC
- || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
|| GET_CODE (PATTERN (insn)) == ASM_INPUT);
return;
}
diff --git a/gcc/lra.c b/gcc/lra.c
index 9df24b5ba9a..5c7b0d6cea1 100644
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -1997,10 +1997,9 @@ check_rtl (bool final_p)
FOR_EACH_BB (bb)
FOR_BB_INSNS (bb, insn)
if (NONDEBUG_INSN_P (insn)
+ && ! JUMP_TABLE_DATA_P (insn)
&& GET_CODE (PATTERN (insn)) != USE
&& GET_CODE (PATTERN (insn)) != CLOBBER
- && GET_CODE (PATTERN (insn)) != ADDR_VEC
- && GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC
&& GET_CODE (PATTERN (insn)) != ASM_INPUT)
{
if (final_p)
diff --git a/gcc/reload1.c b/gcc/reload1.c
index cbb945d064e..7d6b5ddce4e 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -3234,10 +3234,9 @@ eliminate_regs_in_insn (rtx insn, int replace)
if (! insn_is_asm && icode < 0)
{
- gcc_assert (GET_CODE (PATTERN (insn)) == USE
+ gcc_assert (JUMP_TABLE_DATA_P (insn)
+ || GET_CODE (PATTERN (insn)) == USE
|| GET_CODE (PATTERN (insn)) == CLOBBER
- || GET_CODE (PATTERN (insn)) == ADDR_VEC
- || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
|| GET_CODE (PATTERN (insn)) == ASM_INPUT
|| DEBUG_INSN_P (insn));
if (DEBUG_INSN_P (insn))
@@ -3645,10 +3644,9 @@ elimination_costs_in_insn (rtx insn)
if (! insn_is_asm && icode < 0)
{
- gcc_assert (GET_CODE (PATTERN (insn)) == USE
+ gcc_assert (JUMP_TABLE_DATA_P (insn)
+ || GET_CODE (PATTERN (insn)) == USE
|| GET_CODE (PATTERN (insn)) == CLOBBER
- || GET_CODE (PATTERN (insn)) == ADDR_VEC
- || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
|| GET_CODE (PATTERN (insn)) == ASM_INPUT
|| DEBUG_INSN_P (insn));
return;
diff --git a/gcc/reorg.c b/gcc/reorg.c
index c19fb4c4262..51a70dc9bfb 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -2339,9 +2339,7 @@ follow_jumps (rtx label, rtx jump, bool *crossing)
if (ANY_RETURN_P (this_label))
return this_label;
tem = next_active_insn (this_label);
- if (tem
- && (GET_CODE (PATTERN (tem)) == ADDR_VEC
- || GET_CODE (PATTERN (tem)) == ADDR_DIFF_VEC))
+ if (tem && JUMP_TABLE_DATA_P (tem))
break;
if (!targetm.can_follow_jump (jump, insn))