[RTL] emit_insn_before() -- got error

Jim Wilson wilson@specifixinc.com
Tue Apr 6 06:17:00 GMT 2004


Íõ ÒÝ wrote:
> The fllowing 16 lines is my code added into toplev.c:

toplev.c isn't a very good place to be emitting code.  Also, you didn't
say where in toplev.c you are trying to emit code.

As others have mentioned, you need to spend more time trying to debug
gcc.  You won't get very far if you have to ask for help everytime you
write a few lines of code.

>   rtx my_fmt = gen_rtx(CONST_STRING, VOIDmode, "the check_var1 is %d\n");

CONST_STRING can't be used for RTL.  There isn't anyway to represent a
string in RTL.  You will have to create a tree, and then expand the tree
to rtl, which will call output_constant_def.  Maybe you can call that
directly, but that isn't recommended.

>   rtx var1_rtx = gen_rtx_CONST_INT(VOIDmode, 100);

Just "GEN_INT (100)".
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



More information about the Gcc mailing list