Commit 1b3d8f8a by Geoff Keating Committed by Geoffrey Keating

stmt.c (expand_asm_operands): Twiddle generating_concat_p so that CONCATs are…

stmt.c (expand_asm_operands): Twiddle generating_concat_p so that CONCATs are not generated for ASMs.

* stmt.c (expand_asm_operands): Twiddle generating_concat_p
so that CONCATs are not generated for ASMs.
* emit-rtl.c (gen_reg_rtx): Don't generate CONCATs when
not generating_concat_p.
* function.c (pop_function_context_from): Reset
generating_concat_p.
(prepare_function_start): Likewise.
* rtl.c (generating_concat_p): Define.
* rtl.h (generating_concat_p): Declare.
* toplev.c (rest_of_compilation): No CONCATs after RTL generation.

From-SVN: r36088
parent b7fc330e
2000-08-31 Geoffrey Keating <geoffk@cygnus.com>
* stmt.c (expand_asm_operands): Twiddle generating_concat_p
so that CONCATs are not generated for ASMs.
* emit-rtl.c (gen_reg_rtx): Don't generate CONCATs when
not generating_concat_p.
* function.c (pop_function_context_from): Reset
generating_concat_p.
(prepare_function_start): Likewise.
* rtl.c (generating_concat_p): Define.
* rtl.h (generating_concat_p): Declare.
* toplev.c (rest_of_compilation): No CONCATs after RTL generation.
2000-08-22 Philipp Thomas <pthomas@suse.de> 2000-08-22 Philipp Thomas <pthomas@suse.de>
Masanobu Yuhara <yuhara@flab.fujitsu.co.jp> Masanobu Yuhara <yuhara@flab.fujitsu.co.jp>
......
...@@ -539,8 +539,9 @@ gen_reg_rtx (mode) ...@@ -539,8 +539,9 @@ gen_reg_rtx (mode)
if (no_new_pseudos) if (no_new_pseudos)
abort (); abort ();
if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT if (generating_concat_p
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_INT) && (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_INT))
{ {
/* For complex modes, don't make a single pseudo. /* For complex modes, don't make a single pseudo.
Instead, make a CONCAT of two pseudos. Instead, make a CONCAT of two pseudos.
......
...@@ -413,6 +413,7 @@ pop_function_context_from (context) ...@@ -413,6 +413,7 @@ pop_function_context_from (context)
/* Reset variables that have known state during rtx generation. */ /* Reset variables that have known state during rtx generation. */
rtx_equal_function_value_matters = 1; rtx_equal_function_value_matters = 1;
virtuals_instantiated = 0; virtuals_instantiated = 0;
generating_concat_p = 1;
} }
void void
...@@ -5920,6 +5921,9 @@ prepare_function_start () ...@@ -5920,6 +5921,9 @@ prepare_function_start ()
/* Indicate that we have not instantiated virtual registers yet. */ /* Indicate that we have not instantiated virtual registers yet. */
virtuals_instantiated = 0; virtuals_instantiated = 0;
/* Indicate that we want CONCATs now. */
generating_concat_p = 1;
/* Indicate we have no need of a frame pointer yet. */ /* Indicate we have no need of a frame pointer yet. */
frame_pointer_needed = 0; frame_pointer_needed = 0;
......
...@@ -578,6 +578,9 @@ shallow_copy_rtx (orig) ...@@ -578,6 +578,9 @@ shallow_copy_rtx (orig)
/* This is 1 until after the rtl generation pass. */ /* This is 1 until after the rtl generation pass. */
int rtx_equal_function_value_matters; int rtx_equal_function_value_matters;
/* Nonzero when we are generating CONCATs. */
int generating_concat_p;
/* Return 1 if X and Y are identical-looking rtx's. /* Return 1 if X and Y are identical-looking rtx's.
This is the Lisp function EQUAL for rtx arguments. */ This is the Lisp function EQUAL for rtx arguments. */
......
...@@ -1102,6 +1102,9 @@ extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS]; ...@@ -1102,6 +1102,9 @@ extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS];
This is 1 until after the rtl generation pass. */ This is 1 until after the rtl generation pass. */
extern int rtx_equal_function_value_matters; extern int rtx_equal_function_value_matters;
/* Nonzero when we are generating CONCATs. */
extern int generating_concat_p;
/* Generally useful functions. */ /* Generally useful functions. */
/* The following functions accept a wide integer argument. Rather than /* The following functions accept a wide integer argument. Rather than
......
...@@ -1330,6 +1330,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) ...@@ -1330,6 +1330,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
= (enum machine_mode *) alloca (noutputs * sizeof (enum machine_mode)); = (enum machine_mode *) alloca (noutputs * sizeof (enum machine_mode));
/* The insn we have emitted. */ /* The insn we have emitted. */
rtx insn; rtx insn;
int old_generating_concat_p = generating_concat_p;
/* An ASM with no outputs needs to be treated as volatile, for now. */ /* An ASM with no outputs needs to be treated as volatile, for now. */
if (noutputs == 0) if (noutputs == 0)
...@@ -1537,6 +1538,8 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) ...@@ -1537,6 +1538,8 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
Make the asm insn write into that, then our caller will copy it to Make the asm insn write into that, then our caller will copy it to
the real output operand. Likewise for promoted variables. */ the real output operand. Likewise for promoted variables. */
generating_concat_p = 0;
real_output_rtx[i] = NULL_RTX; real_output_rtx[i] = NULL_RTX;
if ((TREE_CODE (val) == INDIRECT_REF if ((TREE_CODE (val) == INDIRECT_REF
&& allows_mem) && allows_mem)
...@@ -1556,7 +1559,8 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) ...@@ -1556,7 +1559,8 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
if (! allows_reg && GET_CODE (output_rtx[i]) != MEM) if (! allows_reg && GET_CODE (output_rtx[i]) != MEM)
error ("output number %d not directly addressable", i); error ("output number %d not directly addressable", i);
if (! allows_mem && GET_CODE (output_rtx[i]) == MEM) if ((! allows_mem && GET_CODE (output_rtx[i]) == MEM)
|| GET_CODE (output_rtx[i]) == CONCAT)
{ {
real_output_rtx[i] = protect_from_queue (output_rtx[i], 1); real_output_rtx[i] = protect_from_queue (output_rtx[i], 1);
output_rtx[i] = gen_reg_rtx (GET_MODE (output_rtx[i])); output_rtx[i] = gen_reg_rtx (GET_MODE (output_rtx[i]));
...@@ -1570,6 +1574,8 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) ...@@ -1570,6 +1574,8 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
TREE_VALUE (tail) = make_tree (type, output_rtx[i]); TREE_VALUE (tail) = make_tree (type, output_rtx[i]);
} }
generating_concat_p = old_generating_concat_p;
if (is_inout) if (is_inout)
{ {
inout_mode[ninout] = TYPE_MODE (TREE_TYPE (TREE_VALUE (tail))); inout_mode[ninout] = TYPE_MODE (TREE_TYPE (TREE_VALUE (tail)));
...@@ -1727,6 +1733,11 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) ...@@ -1727,6 +1733,11 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
op = expand_expr (TREE_VALUE (tail), NULL_RTX, VOIDmode, 0); op = expand_expr (TREE_VALUE (tail), NULL_RTX, VOIDmode, 0);
/* Never pass a CONCAT to an ASM. */
generating_concat_p = 0;
if (GET_CODE (op) == CONCAT)
op = force_reg (GET_MODE (op), op);
if (asm_operand_ok (op, constraint) <= 0) if (asm_operand_ok (op, constraint) <= 0)
{ {
if (allows_reg) if (allows_reg)
...@@ -1759,6 +1770,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) ...@@ -1759,6 +1770,7 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
not satisfied. */ not satisfied. */
warning ("asm operand %d probably doesn't match constraints", i); warning ("asm operand %d probably doesn't match constraints", i);
} }
generating_concat_p = old_generating_concat_p;
XVECEXP (body, 3, i) = op; XVECEXP (body, 3, i) = op;
XVECEXP (body, 4, i) /* constraints */ XVECEXP (body, 4, i) /* constraints */
...@@ -1770,6 +1782,8 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) ...@@ -1770,6 +1782,8 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
/* Protect all the operands from the queue now that they have all been /* Protect all the operands from the queue now that they have all been
evaluated. */ evaluated. */
generating_concat_p = 0;
for (i = 0; i < ninputs - ninout; i++) for (i = 0; i < ninputs - ninout; i++)
XVECEXP (body, 3, i) = protect_from_queue (XVECEXP (body, 3, i), 0); XVECEXP (body, 3, i) = protect_from_queue (XVECEXP (body, 3, i), 0);
...@@ -1787,6 +1801,8 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) ...@@ -1787,6 +1801,8 @@ expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
= gen_rtx_ASM_INPUT (inout_mode[i], digit_strings[j]); = gen_rtx_ASM_INPUT (inout_mode[i], digit_strings[j]);
} }
generating_concat_p = old_generating_concat_p;
/* Now, for each output, construct an rtx /* Now, for each output, construct an rtx
(set OUTPUT (asm_operands INSN OUTPUTNUMBER OUTPUTCONSTRAINT (set OUTPUT (asm_operands INSN OUTPUTNUMBER OUTPUTCONSTRAINT
ARGVEC CONSTRAINTS)) ARGVEC CONSTRAINTS))
......
...@@ -2662,6 +2662,10 @@ rest_of_compilation (decl) ...@@ -2662,6 +2662,10 @@ rest_of_compilation (decl)
timevar_push (TV_REST_OF_COMPILATION); timevar_push (TV_REST_OF_COMPILATION);
/* Now that we're out of the frontend, we shouldn't have any more
CONCATs anywhere. */
generating_concat_p = 0;
/* When processing delayed functions, prepare_function_start() won't /* When processing delayed functions, prepare_function_start() won't
have been run to re-initialize it. */ have been run to re-initialize it. */
cse_not_expected = ! optimize; cse_not_expected = ! optimize;
......
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