aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2011-04-01 08:19:13 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2011-04-01 08:19:13 +0000
commitf04713eea7336eac4f636b6b46e64ec72ab68290 (patch)
tree18171d82f2b441c17a136254dc520ee70b3b96ee /gcc
parentb29387eec60251cbfed25475892d5645c9c59caf (diff)
downloadgcc-f04713eea7336eac4f636b6b46e64ec72ab68290.zip
gcc-f04713eea7336eac4f636b6b46e64ec72ab68290.tar.gz
gcc-f04713eea7336eac4f636b6b46e64ec72ab68290.tar.bz2
expr.c (emit_block_move_via_movmem): Use n_generator_args instead of n_operands.
gcc/ * expr.c (emit_block_move_via_movmem): Use n_generator_args instead of n_operands. (set_storage_via_setmem): Likewise. * optabs.c (maybe_gen_insn): Likewise. * config/arm/arm.c (arm_init_neon_builtins): Likewise. * config/mips/mips.c (mips_expand_builtin_compare_1): Likewise. (mips_expand_builtin_direct): Likewise. * config/spu/spu.c (expand_builtin_args): Likewise. From-SVN: r171823
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/arm/arm.c2
-rw-r--r--gcc/config/mips/mips.c10
-rw-r--r--gcc/config/spu/spu.c4
-rw-r--r--gcc/expr.c14
-rw-r--r--gcc/optabs.c4
6 files changed, 22 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 32ad1da..c38662a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
2011-04-01 Richard Sandiford <richard.sandiford@linaro.org>
+ * expr.c (emit_block_move_via_movmem): Use n_generator_args
+ instead of n_operands.
+ (set_storage_via_setmem): Likewise.
+ * optabs.c (maybe_gen_insn): Likewise.
+ * config/arm/arm.c (arm_init_neon_builtins): Likewise.
+ * config/mips/mips.c (mips_expand_builtin_compare_1): Likewise.
+ (mips_expand_builtin_direct): Likewise.
+ * config/spu/spu.c (expand_builtin_args): Likewise.
+
+2011-04-01 Richard Sandiford <richard.sandiford@linaro.org>
+
* recog.h (insn_data_d): Add n_generator_args.
* genoutput.c (data): Likewise.
(output_insn_data): Print it.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 56dc85e..4fee4da 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -18944,7 +18944,7 @@ arm_init_neon_builtins (void)
/* Build a function type directly from the insn_data for this
builtin. The build_function_type() function takes care of
removing duplicates for us. */
- for (k = insn_data[icode].n_operands - 1; k >= 0; k--)
+ for (k = insn_data[icode].n_generator_args - 1; k >= 0; k--)
{
tree eltype;
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 643e507..74c7ba5 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -13252,7 +13252,7 @@ mips_expand_builtin_compare_1 (enum insn_code icode,
/* The instruction should have a target operand, an operand for each
argument, and an operand for COND. */
- gcc_assert (nargs + 2 == insn_data[(int) icode].n_operands);
+ gcc_assert (nargs + 2 == insn_data[(int) icode].n_generator_args);
opno = 0;
create_output_operand (&ops[opno++], NULL_RTX,
@@ -13280,11 +13280,9 @@ mips_expand_builtin_direct (enum insn_code icode, rtx target, tree exp,
if (has_target_p)
create_output_operand (&ops[opno++], target, TYPE_MODE (TREE_TYPE (exp)));
- /* Map the arguments to the other operands. The n_operands value
- for an expander includes match_dups and match_scratches as well as
- match_operands, so n_operands is only an upper bound on the number
- of arguments to the expander function. */
- gcc_assert (opno + call_expr_nargs (exp) <= insn_data[icode].n_operands);
+ /* Map the arguments to the other operands. */
+ gcc_assert (opno + call_expr_nargs (exp)
+ == insn_data[icode].n_generator_args);
for (argno = 0; argno < call_expr_nargs (exp); argno++)
mips_prepare_builtin_arg (&ops[opno++], exp, argno);
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 46bc586..8a5928b 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -6545,9 +6545,7 @@ expand_builtin_args (struct spu_builtin_description *d, tree exp,
ops[i] = expand_expr (arg, NULL_RTX, VOIDmode, EXPAND_NORMAL);
}
- /* The insn pattern may have additional operands (SCRATCH).
- Return the number of actual non-SCRATCH operands. */
- gcc_assert (i <= insn_data[icode].n_operands);
+ gcc_assert (i == insn_data[icode].n_generator_args);
return i;
}
diff --git a/gcc/expr.c b/gcc/expr.c
index ca61804..4cbb09b 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -1293,11 +1293,8 @@ emit_block_move_via_movmem (rtx x, rtx y, rtx size, unsigned int align,
nice if there were some way to inform the backend, so
that it doesn't fail the expansion because it thinks
emitting the libcall would be more efficient. */
- nops = insn_data[(int) code].n_operands;
- /* ??? n_operands includes match_scratches; find some other
- way to select the 6 operand variant, or force all targets
- to have exactly 6 operands. */
- gcc_assert (nops >= 4 && nops <= 6);
+ nops = insn_data[(int) code].n_generator_args;
+ gcc_assert (nops == 4 || nops == 6);
create_fixed_operand (&ops[0], x);
create_fixed_operand (&ops[1], y);
@@ -2719,11 +2716,8 @@ set_storage_via_setmem (rtx object, rtx size, rtx val, unsigned int align,
struct expand_operand ops[6];
unsigned int nops;
- nops = insn_data[(int) code].n_operands;
- /* ??? n_operands includes match_scratches; find some other
- way to select the 6 operand variant, or force all targets
- to have exactly 6 operands. */
- gcc_assert (nops >= 4 && nops <= 6);
+ nops = insn_data[(int) code].n_generator_args;
+ gcc_assert (nops == 4 || nops == 6);
create_fixed_operand (&ops[0], object);
/* The check above guarantees that this size conversion is valid. */
diff --git a/gcc/optabs.c b/gcc/optabs.c
index e60abf8..682b8e4 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -7118,9 +7118,7 @@ rtx
maybe_gen_insn (enum insn_code icode, unsigned int nops,
struct expand_operand *ops)
{
- /* n_operands includes any automatically-generated match_scratches,
- so we can't check for equality here. */
- gcc_assert (nops <= (unsigned int) insn_data[(int) icode].n_operands);
+ gcc_assert (nops == (unsigned int) insn_data[(int) icode].n_generator_args);
if (!maybe_legitimize_operands (icode, 0, nops, ops))
return NULL_RTX;