This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[RTL] emit_insn_before() -- got error
- From: 王 逸 <cnnjuwy at hotmail dot com>
- To: <gcc at gcc dot gnu dot org>,<gcc-patch at gcc dot gnu dot org>
- Date: Sat, 3 Apr 2004 22:46:24 +0800
- Subject: [RTL] emit_insn_before() -- got error
Hi, all!
I tried to add a few rtl code into gcc/toplev.c
and I've got a error at emit_insn_before()
error msg:
/mnt/extend2/wangyi/build/gcc/xgcc -B/mnt/extend2/wangyi/build/gcc/ -B~/install/new-patchedgcc//i686-pc-linux-gnu/bin/ -B~/install/new-patchedgcc//i686-pc-linux-gnu/lib/ -isystem ~/install/new-patchedgcc//i686-pc-linux-gnu/include -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../patchedgcc/gcc -I../../patchedgcc/gcc/. -I../../patchedgcc/gcc/config -I../../patchedgcc/gcc/../include -DL_muldi3 -c ../../patchedgcc/gcc/libgcc2.c -o libgcc/./_muldi3.o
../../patchedgcc/gcc/libgcc2.c: In function `__muldi3':
../../patchedgcc/gcc/libgcc2.c:366: internal compiler error: in instantiate_virtual_regs_lossage, at function.c:3795
Please submit a full bug report,with preprocessed source if appropriate.
Then I looked for instantiate_virtual_regs_lossage at function.c and it says that means non-matching instruction has been emit.
What ever does this "non-matching instruction" means?
Would someone tell me, please?
The fllowing 16 lines is my code added into toplev.c:
/*code begins*/
rtx my_fmt = gen_rtx(CONST_STRING, VOIDmode, "the check_var1 is %d\n");
rtx var1_rtx = gen_rtx_CONST_INT(VOIDmode, 100);
rtx my_insert_insn;
start_sequence();
emit_library_call(gen_rtx_SYMBOL_REF(SImode, "__printf"), LCT_NORMAL, SImode, 2,
my_fmt, SImode,
var1_rtx, SImode);
my_insert_insn = get_insns();
end_sequence();
/*insert the above rtx before a "REAL" insn*/
rtx my_first_insn = get_insns();
rtx my_insn;
for (my_insn = my_first_insn; my_insn != 0; my_insn = NEXT_INSN(my_insn))
if(GET_CODE(my_insn) != NOTE)
break;
if (my_insn != 0)
emit_insn_before(my_insert_insn, my_insn);//if I replace this statement with null statement, it compiles O.K. with no error.
/*code ends*/