diff options
author | David Malcolm <dmalcolm@redhat.com> | 2014-08-29 00:07:51 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2014-08-29 00:07:51 +0000 |
commit | 17f385d8dabbfff8eeb45012d63c8cd232958330 (patch) | |
tree | 8f06167e65a551690e63c81678d1990d5e257be2 /gcc | |
parent | 3064b94272037d53a8c9886c3e347c063d2f0a40 (diff) | |
download | gcc-17f385d8dabbfff8eeb45012d63c8cd232958330.zip gcc-17f385d8dabbfff8eeb45012d63c8cd232958330.tar.gz gcc-17f385d8dabbfff8eeb45012d63c8cd232958330.tar.bz2 |
Make insn_addresses_new require an rtx_insn
gcc/
2014-08-28 David Malcolm <dmalcolm@redhat.com>
* insn-addr.h (insn_addresses_new): Strengthen param "insn" from
rtx to rtx_insn *.
* config/s390/s390.c (s390_split_branches): Eliminate top-level
local rtx "tmp", in favor of new local rtx "mem" and rtx_insn *
"set_insn".
(s390_mainpool_finish): In three places, split out a local rtx
"insn" into a local rtx - "set" or "pat" - and a rtx_insn *
"insn". Strengthen local "pool_end" from rtx to rtx_code_label *
and split another local rtx "insn" out into rtx "pat" and
rtx_insn * "insn".
* config/sh/sh.c (output_branchy_insn): Rather than working
directly on operands[9], introduce local rtx_code_label *
variables named "lab" in two places, working on them, and then
assigning them to operands[9], so that the intervening operations
are known by the type system to be on insns.
From-SVN: r214701
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 18 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 30 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 14 | ||||
-rw-r--r-- | gcc/insn-addr.h | 2 |
4 files changed, 42 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1c6df0d..a928f92 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,23 @@ 2014-08-28 David Malcolm <dmalcolm@redhat.com> + * insn-addr.h (insn_addresses_new): Strengthen param "insn" from + rtx to rtx_insn *. + * config/s390/s390.c (s390_split_branches): Eliminate top-level + local rtx "tmp", in favor of new local rtx "mem" and rtx_insn * + "set_insn". + (s390_mainpool_finish): In three places, split out a local rtx + "insn" into a local rtx - "set" or "pat" - and a rtx_insn * + "insn". Strengthen local "pool_end" from rtx to rtx_code_label * + and split another local rtx "insn" out into rtx "pat" and + rtx_insn * "insn". + * config/sh/sh.c (output_branchy_insn): Rather than working + directly on operands[9], introduce local rtx_code_label * + variables named "lab" in two places, working on them, and then + assigning them to operands[9], so that the intervening operations + are known by the type system to be on insns. + +2014-08-28 David Malcolm <dmalcolm@redhat.com> + * rtl.h (INSN_HAS_LOCATION): Strengthen param from const_rtx to const rtx_insn *. diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index fbaef45..5933b96 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -6030,7 +6030,7 @@ s390_split_branches (void) rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM); int new_literal = 0, ret; rtx_insn *insn; - rtx pat, tmp, target; + rtx pat, target; rtx *label; /* We need correct insn addresses. */ @@ -6076,10 +6076,10 @@ s390_split_branches (void) if (!flag_pic) { new_literal = 1; - tmp = force_const_mem (Pmode, *label); - tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, tmp), insn); - INSN_ADDRESSES_NEW (tmp, -1); - annotate_constant_pool_refs (&PATTERN (tmp)); + rtx mem = force_const_mem (Pmode, *label); + rtx_insn *set_insn = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, mem), insn); + INSN_ADDRESSES_NEW (set_insn, -1); + annotate_constant_pool_refs (&PATTERN (set_insn)); target = temp_reg; } @@ -6090,9 +6090,9 @@ s390_split_branches (void) UNSPEC_LTREL_OFFSET); target = gen_rtx_CONST (Pmode, target); target = force_const_mem (Pmode, target); - tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, target), insn); - INSN_ADDRESSES_NEW (tmp, -1); - annotate_constant_pool_refs (&PATTERN (tmp)); + rtx_insn *set_insn = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, target), insn); + INSN_ADDRESSES_NEW (set_insn, -1); + annotate_constant_pool_refs (&PATTERN (set_insn)); target = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, XEXP (target, 0), cfun->machine->base_reg), @@ -6759,8 +6759,8 @@ s390_mainpool_finish (struct constant_pool *pool) located in the .rodata section, so we emit it after the function. */ if (TARGET_CPU_ZARCH) { - rtx insn = gen_main_base_64 (base_reg, pool->label); - insn = emit_insn_after (insn, pool->pool_insn); + rtx set = gen_main_base_64 (base_reg, pool->label); + rtx_insn *insn = emit_insn_after (set, pool->pool_insn); INSN_ADDRESSES_NEW (insn, -1); remove_insn (pool->pool_insn); @@ -6777,8 +6777,8 @@ s390_mainpool_finish (struct constant_pool *pool) else if (INSN_ADDRESSES (INSN_UID (pool->emit_pool_after)) + pool->size + 8 /* alignment slop */ < 4096) { - rtx insn = gen_main_base_31_small (base_reg, pool->label); - insn = emit_insn_after (insn, pool->pool_insn); + rtx set = gen_main_base_31_small (base_reg, pool->label); + rtx_insn *insn = emit_insn_after (set, pool->pool_insn); INSN_ADDRESSES_NEW (insn, -1); remove_insn (pool->pool_insn); @@ -6800,10 +6800,10 @@ s390_mainpool_finish (struct constant_pool *pool) over it, setting up the pool register at the same time. */ else { - rtx pool_end = gen_label_rtx (); + rtx_code_label *pool_end = gen_label_rtx (); - rtx insn = gen_main_base_31_large (base_reg, pool->label, pool_end); - insn = emit_jump_insn_after (insn, pool->pool_insn); + rtx pat = gen_main_base_31_large (base_reg, pool->label, pool_end); + rtx_insn *insn = emit_jump_insn_after (pat, pool->pool_insn); JUMP_LABEL (insn) = pool_end; INSN_ADDRESSES_NEW (insn, -1); remove_insn (pool->pool_insn); diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 1165713..dbfaade 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -2856,11 +2856,12 @@ output_branchy_insn (enum rtx_code code, const char *templ, if (GET_CODE (src) == IF_THEN_ELSE && GET_CODE (XEXP (src, 0)) != code) { /* Following branch not taken */ - operands[9] = gen_label_rtx (); - emit_label_after (operands[9], next_insn); - INSN_ADDRESSES_NEW (operands[9], + rtx_code_label *lab = gen_label_rtx (); + emit_label_after (lab, next_insn); + INSN_ADDRESSES_NEW (lab, INSN_ADDRESSES (INSN_UID (next_insn)) + get_attr_length (next_insn)); + operands[9] = lab; return templ; } else @@ -2877,11 +2878,12 @@ output_branchy_insn (enum rtx_code code, const char *templ, } } } - operands[9] = gen_label_rtx (); - emit_label_after (operands[9], insn); - INSN_ADDRESSES_NEW (operands[9], + rtx_code_label *lab = gen_label_rtx (); + emit_label_after (lab, insn); + INSN_ADDRESSES_NEW (lab, INSN_ADDRESSES (INSN_UID (insn)) + get_attr_length (insn)); + operands[9] = lab; return templ; } diff --git a/gcc/insn-addr.h b/gcc/insn-addr.h index aec09fd..e255ac4 100644 --- a/gcc/insn-addr.h +++ b/gcc/insn-addr.h @@ -38,7 +38,7 @@ extern int insn_current_address; #define INSN_ADDRESSES_SIZE() (insn_addresses_.length ()) static inline void -insn_addresses_new (rtx insn, int insn_addr) +insn_addresses_new (rtx_insn *insn, int insn_addr) { unsigned insn_uid = INSN_UID ((insn)); |