This is the mail archive of the 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]Access rtx oprands

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

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