aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2000-09-11 21:03:26 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2000-09-11 21:03:26 +0000
commitb5d7770c3e686d58e4ce1e1b49c35eec2c0475bb (patch)
tree1d26f3ff7a587dc7f37d23724c0dac8615974381
parentda88b352787b53926ba3038983289a59ddaea887 (diff)
downloadgcc-b5d7770c3e686d58e4ce1e1b49c35eec2c0475bb.zip
gcc-b5d7770c3e686d58e4ce1e1b49c35eec2c0475bb.tar.gz
gcc-b5d7770c3e686d58e4ce1e1b49c35eec2c0475bb.tar.bz2
print-rtl.c (debug_call_placeholder_verbose): New variable.
* print-rtl.c (debug_call_placeholder_verbose): New variable. (print_rtx) [CALL_PLACEHOLDER]: Dump all call sequences if it is set. * integrate.c (copy_rtx_and_substitute): Don't share LEAF_REG_REMAPpable registers with the inlined function. Don't share the function value with calling sequences. From-SVN: r36329
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/integrate.c33
-rw-r--r--gcc/print-rtl.c34
3 files changed, 73 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a2e3b40..1f902ca 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2000-09-11 Alexandre Oliva <aoliva@redhat.com>
+
+ * print-rtl.c (debug_call_placeholder_verbose): New variable.
+ (print_rtx) [CALL_PLACEHOLDER]: Dump all call sequences if it is
+ set.
+ * integrate.c (copy_rtx_and_substitute): Don't share
+ LEAF_REG_REMAPpable registers with the inlined function. Don't
+ share the function value with calling sequences.
+
2000-09-11 Jakub Jelinek <jakub@redhat.com>
* c-decl.c (do_case): Fix a typo.
diff --git a/gcc/integrate.c b/gcc/integrate.c
index 7066675..6128aaf 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -1746,7 +1746,15 @@ copy_rtx_and_substitute (orig, map, for_lhs)
{
/* Some hard registers are also mapped,
but others are not translated. */
- if (map->reg_map[regno] != 0)
+ if (map->reg_map[regno] != 0
+ /* We shouldn't usually have reg_map set for return
+ register, but it may happen if we have leaf-register
+ remapping and the return register is used in one of
+ the calling sequences of a call_placeholer. In this
+ case, we'll end up with a reg_map set for this
+ register, but we don't want to use for registers
+ marked as return values. */
+ && ! REG_FUNCTION_VALUE_P (orig))
return map->reg_map[regno];
/* If this is the virtual frame pointer, make space in current
@@ -1757,7 +1765,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
equivalence for it to be the address. This will substitute the
address into insns where it can be substituted and use the new
pseudo where it can't. */
- if (regno == VIRTUAL_STACK_VARS_REGNUM)
+ else if (regno == VIRTUAL_STACK_VARS_REGNUM)
{
rtx loc, seq;
int size = get_func_frame_size (DECL_SAVED_INSNS (map->fndecl));
@@ -1844,7 +1852,26 @@ copy_rtx_and_substitute (orig, map, for_lhs)
else
return map->inline_target;
}
- return orig;
+#if defined (LEAF_REGISTERS) && defined (LEAF_REG_REMAP)
+ /* If leaf_renumber_regs_insn() might remap this register to
+ some other number, make sure we don't share it with the
+ inlined function, otherwise delayed optimization of the
+ inlined function may change it in place, breaking our
+ reference to it. We may still shared it within the
+ function, so create an entry for this register in the
+ reg_map. */
+ if (map->integrating && regno < FIRST_PSEUDO_REGISTER
+ && LEAF_REGISTERS[regno] && LEAF_REG_REMAP (regno) != regno)
+ {
+ temp = gen_rtx_REG (mode, regno);
+ map->reg_map[regno] = temp;
+ return temp;
+ }
+#endif
+ else
+ return orig;
+
+ abort ();
}
if (map->reg_map[regno] == NULL)
{
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 5d7cd5f..31eac81 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -63,6 +63,9 @@ int flag_dump_unnumbered = 0;
/* Nonzero if we are dumping graphical description. */
int dump_for_graph;
+/* Nonzero to dump all call_placeholder alternatives. */
+static int debug_call_placeholder_verbose;
+
/* Print IN_RTX onto OUTFILE. This is the recursive part of printing. */
static void
@@ -421,6 +424,37 @@ print_rtx (in_rtx)
break;
case CALL_PLACEHOLDER:
+ if (debug_call_placeholder_verbose)
+ {
+ fputs (" (cond [\n (const_string \"normal\") (sequence [", outfile);
+ for (tem = XEXP (in_rtx, 0); tem != 0; tem = NEXT_INSN (tem))
+ {
+ fputs ("\n ", outfile);
+ print_inline_rtx (outfile, tem, 4);
+ }
+
+ tem = XEXP (in_rtx, 1);
+ if (tem)
+ fputs ("\n ])\n (const_string \"tail_call\") (sequence [", outfile);
+ for (; tem != 0; tem = NEXT_INSN (tem))
+ {
+ fputs ("\n ", outfile);
+ print_inline_rtx (outfile, tem, 4);
+ }
+
+ tem = XEXP (in_rtx, 2);
+ if (tem)
+ fputs ("\n ])\n (const_string \"tail_recursion\") (sequence [", outfile);
+ for (; tem != 0; tem = NEXT_INSN (tem))
+ {
+ fputs ("\n ", outfile);
+ print_inline_rtx (outfile, tem, 4);
+ }
+
+ fputs ("\n ])\n ])", outfile);
+ break;
+ }
+
for (tem = XEXP (in_rtx, 0); tem != 0; tem = NEXT_INSN (tem))
if (GET_CODE (tem) == CALL_INSN)
{