* rtl.c (currently_expanding_to_rtl): New.
* rtl.h (currently_expanding_to_rtl): Export it.
* cfgexpand.c (tree_cfg_expand): Set/clear it at entry/exit.
* config/alpha/alpha.c (alpha_expand_mov): Remove old RTL
inliner hack.
* config/sh/sh.c: Replace rtx_equal_function_value_matters
with currently_expanding_to_rtl.
* config/sh/sh.md: Likewise.
* config/ia64/ia64.c (got_symbolic_operand): Likewise.
From-SVN: r85287
+2004-07-29 Steven Bosscher <stevenb@suse.de>
+
+ * rtl.c (currently_expanding_to_rtl): New.
+ * rtl.h (currently_expanding_to_rtl): Export it.
+ * cfgexpand.c (tree_cfg_expand): Set/clear it at entry/exit.
+
+ * config/alpha/alpha.c (alpha_expand_mov): Remove old RTL
+ inliner hack.
+ * config/sh/sh.c: Replace rtx_equal_function_value_matters
+ with currently_expanding_to_rtl.
+ * config/sh/sh.md: Likewise.
+ * config/ia64/ia64.c (got_symbolic_operand): Likewise.
+
2004-07-29 Alexandre Oliva <aoliva@redhat.com>
Introduce sh2a support.
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)));
}
+ /* Some backends want to know that we are expanding to RTL. */
+ currently_expanding_to_rtl = 1;
+
/* Prepare the rtl middle end to start recording block changes. */
reset_block_changes ();
construct_exit_block ();
+ /* We're done expanding trees to RTL. */
+ currently_expanding_to_rtl = 0;
+
/* Convert from NOTE_INSN_EH_REGION style notes, and do other
sorts of eh initialization. Delay this until after the
initial rtl dump so that we can see the original nesting. */
{
rtx tmp;
- /* With RTL inlining, at -O3, rtl is generated, stored, then actually
- compiled at the end of compilation. In the meantime, someone can
- re-encode-section-info on some symbol changing it e.g. from global
- to local-not-small. If this happens, we'd have emitted a plain
- load rather than a high+losum load and not recognize the insn.
-
- So if rtl inlining is in effect, we delay the global/not-global
- decision until rest_of_compilation by wrapping it in an
- UNSPEC_SYMBOL. */
- if (TARGET_EXPLICIT_RELOCS && flag_inline_functions
- && rtx_equal_function_value_matters
- && global_symbolic_operand (operands[1], mode))
- {
- emit_insn (gen_movdi_er_maybe_g (operands[0], operands[1]));
- return true;
- }
-
tmp = alpha_legitimize_address (operands[1], operands[0], mode);
if (tmp)
{
/* "Ok" while emitting rtl, since otherwise we won't be provided
with the entire offset during emission, which makes it very
hard to split the offset into high and low parts. */
- if (rtx_equal_function_value_matters)
+ if (currently_expanding_to_rtl)
return 1;
/* Force the low 14 bits of the constant to zero so that we do not
return len + shift_insns[INTVAL (XEXP (op, 1))];
}
-/* Generating rtl? */
-extern int rtx_equal_function_value_matters;
-
/* Generate rtl for instructions for which shl_and_kind advised a particular
method of generating them, i.e. returned zero. */
case 2:
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
- if (rtx_equal_function_value_matters
+ if (currently_expanding_to_rtl
|| reload_in_progress || reload_completed)
{
rtx operands[3];
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
- if (! rtx_equal_function_value_matters
+ if (! currently_expanding_to_rtl
&& ! reload_in_progress && ! reload_completed)
{
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
case 5:
{
int i = 16 - size;
- if (! rtx_equal_function_value_matters
+ if (! currently_expanding_to_rtl
&& ! reload_in_progress && ! reload_completed)
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
else
case 7:
/* Don't expand fine-grained when combining, because that will
make the pattern fail. */
- if (! rtx_equal_function_value_matters
+ if (! currently_expanding_to_rtl
&& ! reload_in_progress && ! reload_completed)
{
emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
(unspec:SI [(match_operand 1 "register_operand" "")] UNSPEC_RA))]
"TARGET_SH1"
"#"
- "&& ! rtx_equal_function_value_matters"
+ "&& ! currently_expanding_to_rtl"
[(set (match_dup 0) (match_dup 1))]
"
{
}
if (sh_expand_t_scc (EQ, operands[0]))
DONE;
- if (! rtx_equal_function_value_matters)
+ if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (EQ);
}")
}
DONE;
}
- if (! rtx_equal_function_value_matters)
+ if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (LT);
}")
}
DONE;
}
- if (! rtx_equal_function_value_matters)
+ if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (GT);
}")
DONE;
}
- if (! rtx_equal_function_value_matters)
+ if (! currently_expanding_to_rtl)
FAIL;
if (GET_MODE_CLASS (GET_MODE (sh_compare_op0)) == MODE_FLOAT)
{
sh_compare_op0, sh_compare_op1));
DONE;
}
- if (! rtx_equal_function_value_matters)
+ if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (GTU);
}")
sh_compare_op1, sh_compare_op0));
DONE;
}
- if (! rtx_equal_function_value_matters)
+ if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (LTU);
}")
DONE;
}
- if (! rtx_equal_function_value_matters)
+ if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (LEU);
}")
DONE;
}
- if (! rtx_equal_function_value_matters)
+ if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (GEU);
}")
if (sh_expand_t_scc (NE, operands[0]))
DONE;
- if (! rtx_equal_function_value_matters)
+ if (! currently_expanding_to_rtl)
FAIL;
operands[1] = prepare_scc_operands (EQ);
operands[2] = gen_reg_rtx (SImode);
\f
/* Nonzero when we are generating CONCATs. */
int generating_concat_p;
+
+/* Nonzero when we are expanding trees to RTL. */
+int currently_expanding_to_rtl;
+
\f
/* Return 1 if X and Y are identical-looking rtx's.
This is the Lisp function EQUAL for rtx arguments. */
/* Nonzero when we are generating CONCATs. */
extern int generating_concat_p;
+/* Nonzero when we are expanding trees to RTL. */
+extern int currently_expanding_to_rtl;
+
/* Generally useful functions. */
/* In expmed.c */