This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RTL]Access rtx oprands
- From: Jim Wilson <wilson at specifixinc dot com>
- To: 王 逸 <cnnjuwy at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 25 Jun 2004 18:30:17 -0700
- Subject: Re: [RTL]Access rtx oprands
- References: <Sea1-DAV36GrhUaCxys00025bf2@hotmail.com>
王 逸 wrote:
> There are some similar usages of XEXP and XSTR in GCC source, I wonder why this one doesn't work?
I don't see anything obviously wrong with the code. You should try
debugging it.
Are you sure the seg-fault occurs here? If the seg-fault occurs in
following code, then there are other ways to explain what is going on.
There could be garbage collection issues for instance. If you are
saving the string name, and trying to use it later, it might have been
freed and garbage collected. In that case, you would have to make a
copy of the string to ensure that you have a copy that won't be garbage
collected. This would explain why using a static string like "ok" would
be safe, as it will never be freed or garbage collected.
> If my method of getting the routine name in an call_insn is wrong, please tell me how to get that.
There is no general way to get the routine name from a call_insn. The
function symbol_ref might have been loaded into a pseudo-reg, and then
moved to another basic block. This could have been an indirect function
call, in which case there never was a function name to begin with. Etc.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com