This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RTL] emit_insn_before() -- got error
- From: Jim Wilson <wilson at specifixinc dot com>
- To: 王 逸 <cnnjuwy at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 05 Apr 2004 23:17:49 -0700
- Subject: Re: [RTL] emit_insn_before() -- got error
- References: <Sea1-DAV68gdjMGJ1Re00013c4c@hotmail.com>
王 逸 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