This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Splitter for call insn
- To: gcc-patches at gcc dot gnu dot org
- Subject: Splitter for call insn
- From: kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Date: Sat, 26 Aug 2000 09:05:25 +0900
Hi,
We use splitters for call insns in our experimental PIC
support for SH target. Recently it has stopped to work.
It seems that try_split takes away REG_NOTES and
CALL_INSN_FUNCTION_USAGE informations from the splitted
call insn. Now I'm trying the following work around:
---- cvs/egcs/gcc/emit-rtl.c Sat Aug 26 00:51:30 2000
+++ egcs/gcc/emit-rtl.c Sat Aug 26 08:40:54 2000
@@ -2440,6 +2440,18 @@
LABEL_NUSES (JUMP_LABEL (trial))++;
}
+ if (GET_CODE (trial) == CALL_INSN)
+ for (i = XVECLEN (seq, 0) - 1; i >= 0; i--)
+ if (GET_CODE (XVECEXP (seq, 0, i)) == CALL_INSN)
+ {
+ if (REG_NOTES (trial))
+ REG_NOTES (XVECEXP (seq, 0, i))
+ = copy_rtx (REG_NOTES (trial));
+ if (CALL_INSN_FUNCTION_USAGE (trial))
+ CALL_INSN_FUNCTION_USAGE (XVECEXP (seq, 0, i))
+ = copy_rtx (CALL_INSN_FUNCTION_USAGE (trial));
+ }
+
tem = emit_insn_after (seq, before);
delete_insn (trial);
and anyway it works for our case. But I suspect that this is
the right thing.
Any suggestions will be appreciated.
--
Kazumoto Kojima
kkojima@rr.iij4u.or.jp
http://rr.iij4u.or.jp/~kkojima