This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Handel REG_LIBCALL note after split
- From: Sa Liu <SALIU at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 9 Aug 2007 15:40:39 +0200
- Subject: [PATCH] Handel REG_LIBCALL note after split
This patch relink the insns with REG_LIBCALL note and with REG_RETVAL note
after split.
The discussion in GCC mailing list can be found here:
http://gcc.gnu.org/ml/gcc/2007-07/msg00925.html
The patch has been tested on spu with gcc test suits and got no
regression.
Is it now OK for the mainline?
Thanks,
Sa
Index: gcc/emit-rtl.c
===================================================================
--- gcc.orig/emit-rtl.c
+++ gcc/emit-rtl.c
@@ -3129,7 +3129,7 @@ try_split (rtx pat, rtx trial, int last)
rtx before = PREV_INSN (trial);
rtx after = NEXT_INSN (trial);
int has_barrier = 0;
- rtx tem;
+ rtx tem, note_retval;
rtx note, seq;
int probability;
rtx insn_last, insn;
@@ -3264,6 +3264,16 @@ try_split (rtx pat, rtx trial, int last)
}
break;
#endif
+ case REG_LIBCALL:
+ /* Relink the insns with REG_LIBCALL note and with REG_RETVAL note
+ after split. */
+ REG_NOTES (insn_last)
+ = gen_rtx_EXPR_LIST (REG_LIBCALL,
+ XEXP (note, 0),
+ REG_NOTES (insn_last));
+ note_retval = find_reg_note (XEXP (note, 0), REG_RETVAL,
NULL);
+ XEXP (note_retval, 0) = insn_last;
+ break;
default:
break;