This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[dataflow]: PATCH COMMITTED to fix libcall notes.
- From: Kenneth Zadeck <zadeck at naturalbridge dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>, Daniel Berlin <dberlin at dberlin dot org>, "Edelsohn, David" <dje at watson dot ibm dot com>, Seongbae Park <seongbae dot park at gmail dot com>
- Date: Mon, 09 Apr 2007 16:22:53 -0400
- Subject: [dataflow]: PATCH COMMITTED to fix libcall notes.
This patch fixes a bootstrapping issue on the ppc.
rs6000_legitimize_tls_address seems to generate its own libcalls inline
rather than calling emit_libcall_block. Because of that, it was not
generating the new REG_LIBCALL_ID notes. It may be that the proper fix
is to have this code call emit_libcall_block but that is beyond my
current mandate.
Also, while looking into it, I noticed that we were missing code to
properly remove REG_LIBCALL_ID notes when the other libcall notes are
removed. That has been added to this patch.
This has been bootstrapped and is in the process of being regression
tested on the ppc.
Kenny
2007-04-08 Kenneth Zadeck <zadeck@naturalbridge.com>
* optabs.h (maybe_encapsulate_block): Made public.
* optabs.c (maybe_encapsulate_block): Ditto.
(emit_no_conflict_block, emit_libcall_block): Remove
REG_LIBCALL_ID when deleteing REG_RETVAL and REG_LIBCALL
notes.
* reload1.c (reload): Ditto.
* config/rs6000/rs6000.c (rs6000_legitimize_tls_address):
Use maybe_encapsulate_block to add libcall notes.
Index: optabs.h
===================================================================
--- optabs.h (revision 123660)
+++ optabs.h (working copy)
@@ -604,6 +604,10 @@ extern rtx expand_copysign (rtx, rtx, rt
an input. */
extern void emit_unop_insn (int, rtx, rtx, enum rtx_code);
+/* Excapsulate the block in REG_LIBCALL, and REG_RETVAL reg notes and add
+ REG_LIBCALL_ID notes to all insns in block. */
+extern void maybe_encapsulate_block (rtx, rtx, rtx);
+
/* Emit code to perform a series of operations on a multi-word quantity, one
word at a time. */
extern rtx emit_no_conflict_block (rtx, rtx, rtx, rtx, rtx);
Index: optabs.c
===================================================================
--- optabs.c (revision 123660)
+++ optabs.c (working copy)
@@ -3370,7 +3370,7 @@ no_conflict_move_test (rtx dest, rtx set
logically equivalent to EQUIV, so it gets manipulated as a unit if it
is possible to do so. */
-static void
+void
maybe_encapsulate_block (rtx first, rtx last, rtx equiv)
{
if (!flag_non_call_exceptions || !may_trap_p (equiv))
@@ -3460,6 +3460,8 @@ emit_no_conflict_block (rtx insns, rtx t
remove_note (insn, note);
if ((note = find_reg_note (insn, REG_RETVAL, NULL)) != NULL)
remove_note (insn, note);
+ if ((note = find_reg_note (insn, REG_LIBCALL_ID, NULL)) != NULL)
+ remove_note (insn, note);
data.target = target;
data.first = insns;
@@ -3612,6 +3614,8 @@ emit_libcall_block (rtx insns, rtx targe
remove_note (insn, note);
if ((note = find_reg_note (insn, REG_RETVAL, NULL)) != NULL)
remove_note (insn, note);
+ if ((note = find_reg_note (insn, REG_LIBCALL_ID, NULL)) != NULL)
+ remove_note (insn, note);
next = NEXT_INSN (insn);
Index: reload1.c
===================================================================
--- reload1.c (revision 123660)
+++ reload1.c (working copy)
@@ -1225,6 +1225,7 @@ reload (rtx first, int global)
|| REG_NOTE_KIND (*pnote) == REG_UNUSED
|| REG_NOTE_KIND (*pnote) == REG_INC
|| REG_NOTE_KIND (*pnote) == REG_RETVAL
+ || REG_NOTE_KIND (*pnote) == REG_LIBCALL_ID
|| REG_NOTE_KIND (*pnote) == REG_LIBCALL)
*pnote = XEXP (*pnote, 1);
else
Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c (revision 123660)
+++ config/rs6000/rs6000.c (working copy)
@@ -3458,10 +3458,7 @@ rs6000_legitimize_tls_address (rtx addr,
emit_insn (gen_addsi3 (tmp3, tmp1, tmp2));
last = emit_move_insn (got, tmp3);
set_unique_reg_note (last, REG_EQUAL, gsym);
- REG_NOTES (first) = gen_rtx_INSN_LIST (REG_LIBCALL, last,
- REG_NOTES (first));
- REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first,
- REG_NOTES (last));
+ maybe_encapsulate_block (first, last, gsym);
}
}
}