This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RTL] emit_insn_before() -- got error


王 逸 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]