Commit 329b3cc3 by Kaz Kojima

genemit.c (gen_insn): Call gen_exp with a non-null used when handling multiple insns.

	* genemit.c (gen_insn): Call gen_exp with a non-null used
	when handling multiple insns.
	(gen_expand): Likewise.
	* reorg.c (emit_delay_sequence): Copy the delay slot insn.
	* config/sh/sh.md (ashrsi2_31+1): Copy operands[0].
	(movsi_const_16bit+1): Copy operands[1].
	(call_pcrel): Copy the call_site pattern.
	(call_value_pcrel, sibcall_pcrel, GOTaddr2picreg): Likewise.

From-SVN: r118746
parent 6d55dfe3
2006-11-12 Kaz Kojima <kkojima@gcc.gnu.org>
* genemit.c (gen_insn): Call gen_exp with a non-null used
when handling multiple insns.
(gen_expand): Likewise.
* reorg.c (emit_delay_sequence): Copy the delay slot insn.
* config/sh/sh.md (ashrsi2_31+1): Copy operands[0].
(movsi_const_16bit+1): Copy operands[1].
(call_pcrel): Copy the call_site pattern.
(call_value_pcrel, sibcall_pcrel, GOTaddr2picreg): Likewise.
2006-11-12 Roger Sayle <roger@eyesopen.com> 2006-11-12 Roger Sayle <roger@eyesopen.com>
* fold-const.c (negate_expr_p) <PLUS_EXPR, MINUS_EXPR>: Correct/refine * fold-const.c (negate_expr_p) <PLUS_EXPR, MINUS_EXPR>: Correct/refine
......
...@@ -3752,7 +3752,7 @@ label: ...@@ -3752,7 +3752,7 @@ label:
" "
{ {
emit_insn (gen_ashlsi_c (operands[0], operands[1])); emit_insn (gen_ashlsi_c (operands[0], operands[1]));
emit_insn (gen_mov_neg_si_t (operands[0])); emit_insn (gen_mov_neg_si_t (copy_rtx (operands[0])));
DONE; DONE;
}") }")
...@@ -5113,7 +5113,7 @@ label: ...@@ -5113,7 +5113,7 @@ label:
{ {
rtx insn = emit_insn (gen_movsi_const (operands[0], operands[1])); rtx insn = emit_insn (gen_movsi_const (operands[0], operands[1]));
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1], REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, copy_rtx (operands[1]),
REG_NOTES (insn)); REG_NOTES (insn));
DONE; DONE;
...@@ -5497,7 +5497,7 @@ label: ...@@ -5497,7 +5497,7 @@ label:
else else
insn = emit_insn (gen_movdi_const_32bit (operands[0], operands[1])); insn = emit_insn (gen_movdi_const_32bit (operands[0], operands[1]));
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1], REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, copy_rtx (operands[1]),
REG_NOTES (insn)); REG_NOTES (insn));
DONE; DONE;
...@@ -7390,7 +7390,7 @@ label: ...@@ -7390,7 +7390,7 @@ label:
emit_insn (gen_sym_label2reg (operands[2], operands[0], lab)); emit_insn (gen_sym_label2reg (operands[2], operands[0], lab));
else else
emit_insn (gen_symPLT_label2reg (operands[2], operands[0], lab)); emit_insn (gen_symPLT_label2reg (operands[2], operands[0], lab));
emit_call_insn (gen_calli_pcrel (operands[2], operands[1], lab)); emit_call_insn (gen_calli_pcrel (operands[2], operands[1], copy_rtx (lab)));
DONE; DONE;
}" }"
[(set_attr "type" "call") [(set_attr "type" "call")
...@@ -7494,7 +7494,7 @@ label: ...@@ -7494,7 +7494,7 @@ label:
else else
emit_insn (gen_symPLT_label2reg (operands[3], operands[1], lab)); emit_insn (gen_symPLT_label2reg (operands[3], operands[1], lab));
emit_call_insn (gen_call_valuei_pcrel (operands[0], operands[3], emit_call_insn (gen_call_valuei_pcrel (operands[0], operands[3],
operands[2], lab)); operands[2], copy_rtx (lab)));
DONE; DONE;
}" }"
[(set_attr "type" "call") [(set_attr "type" "call")
...@@ -7875,7 +7875,7 @@ label: ...@@ -7875,7 +7875,7 @@ label:
emit_insn (gen_sym_label2reg (operands[2], operands[0], lab)); emit_insn (gen_sym_label2reg (operands[2], operands[0], lab));
call_insn = emit_call_insn (gen_sibcalli_pcrel (operands[2], operands[1], call_insn = emit_call_insn (gen_sibcalli_pcrel (operands[2], operands[1],
lab)); copy_rtx (lab)));
SIBLING_CALL_P (call_insn) = 1; SIBLING_CALL_P (call_insn) = 1;
DONE; DONE;
}" }"
...@@ -8313,12 +8313,12 @@ label: ...@@ -8313,12 +8313,12 @@ label:
if (Pmode == SImode) if (Pmode == SImode)
{ {
emit_insn (gen_movsi_const (pic, operands[1])); emit_insn (gen_movsi_const (pic, operands[1]));
emit_insn (gen_ptrel_si (tr, pic, lab)); emit_insn (gen_ptrel_si (tr, pic, copy_rtx (lab)));
} }
else else
{ {
emit_insn (gen_movdi_const (pic, operands[1])); emit_insn (gen_movdi_const (pic, operands[1]));
emit_insn (gen_ptrel_di (tr, pic, lab)); emit_insn (gen_ptrel_di (tr, pic, copy_rtx (lab)));
} }
insn = emit_move_insn (operands[0], tr); insn = emit_move_insn (operands[0], tr);
......
...@@ -428,15 +428,18 @@ gen_insn (rtx insn, int lineno) ...@@ -428,15 +428,18 @@ gen_insn (rtx insn, int lineno)
} }
else else
{ {
char *used = XCNEWVEC (char, operands);
printf (" return gen_rtx_PARALLEL (VOIDmode, gen_rtvec (%d", printf (" return gen_rtx_PARALLEL (VOIDmode, gen_rtvec (%d",
XVECLEN (insn, 1)); XVECLEN (insn, 1));
for (i = 0; i < XVECLEN (insn, 1); i++) for (i = 0; i < XVECLEN (insn, 1); i++)
{ {
printf (",\n\t\t"); printf (",\n\t\t");
gen_exp (XVECEXP (insn, 1, i), DEFINE_INSN, NULL); gen_exp (XVECEXP (insn, 1, i), DEFINE_INSN, used);
} }
printf ("));\n}\n\n"); printf ("));\n}\n\n");
XDELETEVEC (used);
} }
} }
...@@ -447,6 +450,7 @@ gen_expand (rtx expand) ...@@ -447,6 +450,7 @@ gen_expand (rtx expand)
{ {
int operands; int operands;
int i; int i;
char *used;
if (strlen (XSTR (expand, 0)) == 0) if (strlen (XSTR (expand, 0)) == 0)
fatal ("define_expand lacks a name"); fatal ("define_expand lacks a name");
...@@ -530,6 +534,8 @@ gen_expand (rtx expand) ...@@ -530,6 +534,8 @@ gen_expand (rtx expand)
Use emit_insn to add them to the sequence being accumulated. Use emit_insn to add them to the sequence being accumulated.
But don't do this if the user's code has set `no_more' nonzero. */ But don't do this if the user's code has set `no_more' nonzero. */
used = XCNEWVEC (char, operands);
for (i = 0; i < XVECLEN (expand, 1); i++) for (i = 0; i < XVECLEN (expand, 1); i++)
{ {
rtx next = XVECEXP (expand, 1, i); rtx next = XVECEXP (expand, 1, i);
...@@ -560,13 +566,15 @@ gen_expand (rtx expand) ...@@ -560,13 +566,15 @@ gen_expand (rtx expand)
printf (" emit ("); printf (" emit (");
else else
printf (" emit_insn ("); printf (" emit_insn (");
gen_exp (next, DEFINE_EXPAND, NULL); gen_exp (next, DEFINE_EXPAND, used);
printf (");\n"); printf (");\n");
if (GET_CODE (next) == SET && GET_CODE (SET_DEST (next)) == PC if (GET_CODE (next) == SET && GET_CODE (SET_DEST (next)) == PC
&& GET_CODE (SET_SRC (next)) == LABEL_REF) && GET_CODE (SET_SRC (next)) == LABEL_REF)
printf (" emit_barrier ();"); printf (" emit_barrier ();");
} }
XDELETEVEC (used);
/* Call `get_insns' to extract the list of all the /* Call `get_insns' to extract the list of all the
insns emitted within this gen_... function. */ insns emitted within this gen_... function. */
......
...@@ -513,7 +513,7 @@ emit_delay_sequence (rtx insn, rtx list, int length) ...@@ -513,7 +513,7 @@ emit_delay_sequence (rtx insn, rtx list, int length)
for (li = list; li; li = XEXP (li, 1), i++) for (li = list; li; li = XEXP (li, 1), i++)
{ {
rtx tem = XEXP (li, 0); rtx tem = copy_rtx (XEXP (li, 0));
rtx note, next; rtx note, next;
/* Show that this copy of the insn isn't deleted. */ /* Show that this copy of the insn isn't deleted. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment