summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-09-09 13:06:43 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-09-09 13:06:43 +0000
commitc338f2e39da17e572e0661ad6a15c59bbfc4b529 (patch)
treeb56dbab169263ce9ad963b7070c7c0593dd51aea
parentd27c9b1ed7103e622b9f72ffe7e4e950443fe96b (diff)
downloadgcc-c338f2e39da17e572e0661ad6a15c59bbfc4b529.tar.gz
gcc/
* alias.c (addr_side_effect_eval): Use gen_int_mode with the mode of the associated gen_rtx_* call. * caller-save.c (init_caller_save): Likewise. * combine.c (find_split_point, make_extraction): Likewise. (make_compound_operation): Likewise. * dwarf2out.c (mem_loc_descriptor): Likewise. * explow.c (plus_constant, probe_stack_range): Likewise. * expmed.c (expand_mult_const): Likewise. * expr.c (emit_single_push_insn_1, do_tablejump): Likewise. * reload1.c (init_reload): Likewise. * valtrack.c (cleanup_auto_inc_dec): Likewise. * var-tracking.c (adjust_mems): Likewise. * modulo-sched.c (sms_schedule): Likewise, but use gen_rtx_GT rather than gen_rtx_fmt_ee. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202391 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog17
-rw-r--r--gcc/alias.c2
-rw-r--r--gcc/caller-save.c2
-rw-r--r--gcc/combine.c19
-rw-r--r--gcc/dwarf2out.c7
-rw-r--r--gcc/explow.c5
-rw-r--r--gcc/expmed.c3
-rw-r--r--gcc/expr.c17
-rw-r--r--gcc/modulo-sched.c5
-rw-r--r--gcc/reload1.c2
-rw-r--r--gcc/valtrack.c7
-rw-r--r--gcc/var-tracking.c16
12 files changed, 67 insertions, 35 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ceaf0e50e55..b20987b98c5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,20 @@
+2013-09-09 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * alias.c (addr_side_effect_eval): Use gen_int_mode with the mode
+ of the associated gen_rtx_* call.
+ * caller-save.c (init_caller_save): Likewise.
+ * combine.c (find_split_point, make_extraction): Likewise.
+ (make_compound_operation): Likewise.
+ * dwarf2out.c (mem_loc_descriptor): Likewise.
+ * explow.c (plus_constant, probe_stack_range): Likewise.
+ * expmed.c (expand_mult_const): Likewise.
+ * expr.c (emit_single_push_insn_1, do_tablejump): Likewise.
+ * reload1.c (init_reload): Likewise.
+ * valtrack.c (cleanup_auto_inc_dec): Likewise.
+ * var-tracking.c (adjust_mems): Likewise.
+ * modulo-sched.c (sms_schedule): Likewise, but use gen_rtx_GT
+ rather than gen_rtx_fmt_ee.
+
2013-09-09 Jan Hubicka <jh@suse.cz>
PR middle-end/58294
diff --git a/gcc/alias.c b/gcc/alias.c
index 18445794f9e..19fe8d840a8 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1895,7 +1895,7 @@ addr_side_effect_eval (rtx addr, int size, int n_refs)
if (offset)
addr = gen_rtx_PLUS (GET_MODE (addr), XEXP (addr, 0),
- GEN_INT (offset));
+ gen_int_mode (offset, GET_MODE (addr)));
else
addr = XEXP (addr, 0);
addr = canon_rtx (addr);
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index 5e65294375e..b134cde1131 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -239,7 +239,7 @@ init_caller_save (void)
for (offset = 1 << (HOST_BITS_PER_INT / 2); offset; offset >>= 1)
{
- address = gen_rtx_PLUS (Pmode, addr_reg, GEN_INT (offset));
+ address = gen_rtx_PLUS (Pmode, addr_reg, gen_int_mode (offset, Pmode));
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (regno_save_mode[i][1] != VOIDmode
diff --git a/gcc/combine.c b/gcc/combine.c
index fc566c55c16..720b8f547e8 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -4725,13 +4725,14 @@ find_split_point (rtx *loc, rtx insn, bool set_src)
if (unsignedp && len <= 8)
{
+ unsigned HOST_WIDE_INT mask
+ = ((unsigned HOST_WIDE_INT) 1 << len) - 1;
SUBST (SET_SRC (x),
gen_rtx_AND (mode,
gen_rtx_LSHIFTRT
(mode, gen_lowpart (mode, inner),
GEN_INT (pos)),
- GEN_INT (((unsigned HOST_WIDE_INT) 1 << len)
- - 1)));
+ gen_int_mode (mask, mode)));
split = find_split_point (&SET_SRC (x), insn, true);
if (split && split != &SET_SRC (x))
@@ -4814,9 +4815,11 @@ find_split_point (rtx *loc, rtx insn, bool set_src)
enum machine_mode mode = GET_MODE (x);
unsigned HOST_WIDE_INT this_int = INTVAL (XEXP (XEXP (x, 1), 1));
HOST_WIDE_INT other_int = trunc_int_for_mode (-this_int, mode);
- SUBST (*loc, gen_rtx_PLUS (mode, gen_rtx_MULT (mode,
- XEXP (XEXP (x, 1), 0),
- GEN_INT (other_int)),
+ SUBST (*loc, gen_rtx_PLUS (mode,
+ gen_rtx_MULT (mode,
+ XEXP (XEXP (x, 1), 0),
+ gen_int_mode (other_int,
+ mode)),
XEXP (x, 0)));
return find_split_point (loc, insn, set_src);
}
@@ -7258,7 +7261,9 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
pos = width - len - pos;
else
pos_rtx
- = gen_rtx_MINUS (GET_MODE (pos_rtx), GEN_INT (width - len), pos_rtx);
+ = gen_rtx_MINUS (GET_MODE (pos_rtx),
+ gen_int_mode (width - len, GET_MODE (pos_rtx)),
+ pos_rtx);
/* POS may be less than 0 now, but we check for that below.
Note that it can only be less than 0 if !MEM_P (inner). */
}
@@ -7490,7 +7495,7 @@ make_compound_operation (rtx x, enum rtx_code in_code)
multval = -multval;
}
multval = trunc_int_for_mode (multval, mode);
- new_rtx = gen_rtx_MULT (mode, new_rtx, GEN_INT (multval));
+ new_rtx = gen_rtx_MULT (mode, new_rtx, gen_int_mode (multval, mode));
}
break;
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index fc1c3f21565..7bf739d154f 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -12386,9 +12386,10 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
/* Turn these into a PLUS expression and fall into the PLUS code
below. */
rtl = gen_rtx_PLUS (mode, XEXP (rtl, 0),
- GEN_INT (GET_CODE (rtl) == PRE_INC
- ? GET_MODE_UNIT_SIZE (mem_mode)
- : -GET_MODE_UNIT_SIZE (mem_mode)));
+ gen_int_mode (GET_CODE (rtl) == PRE_INC
+ ? GET_MODE_UNIT_SIZE (mem_mode)
+ : -GET_MODE_UNIT_SIZE (mem_mode),
+ mode));
/* ... fall through ... */
diff --git a/gcc/explow.c b/gcc/explow.c
index 7da8bc75f19..a69240da40e 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -186,7 +186,7 @@ plus_constant (enum machine_mode mode, rtx x, HOST_WIDE_INT c)
}
if (c != 0)
- x = gen_rtx_PLUS (mode, x, GEN_INT (c));
+ x = gen_rtx_PLUS (mode, x, gen_int_mode (c, mode));
if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)
return x;
@@ -1641,7 +1641,8 @@ probe_stack_range (HOST_WIDE_INT first, rtx size)
/* TEST_ADDR = SP + FIRST. */
test_addr = force_operand (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
stack_pointer_rtx,
- GEN_INT (first)), NULL_RTX);
+ gen_int_mode (first, Pmode)),
+ NULL_RTX);
/* LAST_ADDR = SP + FIRST + ROUNDED_SIZE. */
last_addr = force_operand (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
diff --git a/gcc/expmed.c b/gcc/expmed.c
index d18f09f4889..dfaa123d587 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -3006,7 +3006,8 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val,
insn = get_last_insn ();
set_dst_reg_note (insn, REG_EQUAL,
- gen_rtx_MULT (nmode, tem, GEN_INT (val_so_far)),
+ gen_rtx_MULT (nmode, tem,
+ gen_int_mode (val_so_far, nmode)),
accum_inner);
}
}
diff --git a/gcc/expr.c b/gcc/expr.c
index 167d4f5d5ce..dfe5b3fdf1a 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3926,18 +3926,20 @@ emit_single_push_insn_1 (enum machine_mode mode, rtx x, tree type)
previous value. */
offset -= (HOST_WIDE_INT) rounded_size;
#endif
- dest_addr = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (offset));
+ dest_addr = gen_rtx_PLUS (Pmode, stack_pointer_rtx,
+ gen_int_mode (offset, Pmode));
}
else
{
#ifdef STACK_GROWS_DOWNWARD
/* ??? This seems wrong if STACK_PUSH_CODE == POST_DEC. */
dest_addr = gen_rtx_PLUS (Pmode, stack_pointer_rtx,
- GEN_INT (-(HOST_WIDE_INT) rounded_size));
+ gen_int_mode (-(HOST_WIDE_INT) rounded_size,
+ Pmode));
#else
/* ??? This seems wrong if STACK_PUSH_CODE == POST_INC. */
dest_addr = gen_rtx_PLUS (Pmode, stack_pointer_rtx,
- GEN_INT (rounded_size));
+ gen_int_mode (rounded_size, Pmode));
#endif
dest_addr = gen_rtx_PRE_MODIFY (Pmode, stack_pointer_rtx, dest_addr);
}
@@ -11028,10 +11030,11 @@ do_tablejump (rtx index, enum machine_mode mode, rtx range, rtx table_label,
GET_MODE_SIZE, because this indicates how large insns are. The other
uses should all be Pmode, because they are addresses. This code
could fail if addresses and insns are not the same size. */
- index = gen_rtx_PLUS (Pmode,
- gen_rtx_MULT (Pmode, index,
- GEN_INT (GET_MODE_SIZE (CASE_VECTOR_MODE))),
- gen_rtx_LABEL_REF (Pmode, table_label));
+ index = gen_rtx_PLUS
+ (Pmode,
+ gen_rtx_MULT (Pmode, index,
+ gen_int_mode (GET_MODE_SIZE (CASE_VECTOR_MODE), Pmode)),
+ gen_rtx_LABEL_REF (Pmode, table_label));
#ifdef PIC_CASE_VECTOR_ADDRESS
if (flag_pic)
index = PIC_CASE_VECTOR_ADDRESS (index);
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c
index 0df5fb61a25..a1d0999fd2f 100644
--- a/gcc/modulo-sched.c
+++ b/gcc/modulo-sched.c
@@ -1715,8 +1715,9 @@ sms_schedule (void)
/* case the BCT count is not known , Do loop-versioning */
if (count_reg && ! count_init)
{
- rtx comp_rtx = gen_rtx_fmt_ee (GT, VOIDmode, count_reg,
- GEN_INT(stage_count));
+ rtx comp_rtx = gen_rtx_GT (VOIDmode, count_reg,
+ gen_int_mode (stage_count,
+ GET_MODE (count_reg)));
unsigned prob = (PROB_SMS_ENOUGH_ITERATIONS
* REG_BR_PROB_BASE) / 100;
diff --git a/gcc/reload1.c b/gcc/reload1.c
index b8c3bfabbfb..db183819c85 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -435,7 +435,7 @@ init_reload (void)
gen_rtx_PLUS (Pmode,
gen_rtx_REG (Pmode,
LAST_VIRTUAL_REGISTER + 1),
- GEN_INT (4)));
+ gen_int_mode (4, Pmode)));
spill_indirect_levels = 0;
while (memory_address_p (QImode, tem))
diff --git a/gcc/valtrack.c b/gcc/valtrack.c
index 997f68b5089..c61c11704e4 100644
--- a/gcc/valtrack.c
+++ b/gcc/valtrack.c
@@ -93,9 +93,10 @@ cleanup_auto_inc_dec (rtx src, enum machine_mode mem_mode ATTRIBUTE_UNUSED)
gcc_assert (mem_mode != VOIDmode && mem_mode != BLKmode);
return gen_rtx_PLUS (GET_MODE (x),
cleanup_auto_inc_dec (XEXP (x, 0), mem_mode),
- GEN_INT (code == PRE_INC
- ? GET_MODE_SIZE (mem_mode)
- : -GET_MODE_SIZE (mem_mode)));
+ gen_int_mode (code == PRE_INC
+ ? GET_MODE_SIZE (mem_mode)
+ : -GET_MODE_SIZE (mem_mode),
+ GET_MODE (x)));
case POST_INC:
case POST_DEC:
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index cf1f08bc252..6f8b08dfcc2 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -1045,9 +1045,10 @@ adjust_mems (rtx loc, const_rtx old_rtx, void *data)
case PRE_INC:
case PRE_DEC:
addr = gen_rtx_PLUS (GET_MODE (loc), XEXP (loc, 0),
- GEN_INT (GET_CODE (loc) == PRE_INC
- ? GET_MODE_SIZE (amd->mem_mode)
- : -GET_MODE_SIZE (amd->mem_mode)));
+ gen_int_mode (GET_CODE (loc) == PRE_INC
+ ? GET_MODE_SIZE (amd->mem_mode)
+ : -GET_MODE_SIZE (amd->mem_mode),
+ GET_MODE (loc)));
case POST_INC:
case POST_DEC:
if (addr == loc)
@@ -1055,10 +1056,11 @@ adjust_mems (rtx loc, const_rtx old_rtx, void *data)
gcc_assert (amd->mem_mode != VOIDmode && amd->mem_mode != BLKmode);
addr = simplify_replace_fn_rtx (addr, old_rtx, adjust_mems, data);
tem = gen_rtx_PLUS (GET_MODE (loc), XEXP (loc, 0),
- GEN_INT ((GET_CODE (loc) == PRE_INC
- || GET_CODE (loc) == POST_INC)
- ? GET_MODE_SIZE (amd->mem_mode)
- : -GET_MODE_SIZE (amd->mem_mode)));
+ gen_int_mode ((GET_CODE (loc) == PRE_INC
+ || GET_CODE (loc) == POST_INC)
+ ? GET_MODE_SIZE (amd->mem_mode)
+ : -GET_MODE_SIZE (amd->mem_mode),
+ GET_MODE (loc)));
amd->side_effects = alloc_EXPR_LIST (0,
gen_rtx_SET (VOIDmode,
XEXP (loc, 0),