On Apr 12, 2006, at 10:34 PM, Ching-Hua Chang wrote:
We had ported gcc-3.4.2 to our own RISC, and meet a strange
case in optimization level 3 (-O3).

We don't have the resources to help with very old versions of gcc on this list. I'd recommend upgrading to gcc-4.2. If it then works, you can then compare the old and new compilers to see how the do things differently and what you need to backport to fix the problem.

It seems that there some problem in function in-lining.
What can I do and what should I do to solve this problem?

There is a process called debugging that can be used to solve the problem. First step, -da, and then identify the pass that produces the wrong result. Then, find that pass in the code, then, set a breakpoint at the start of that pass and step forward until you find the bug. You can use the insn UIDs to help narrow the search.

Note, that process doesn't work for things that aren't bugs of course. In this case, I suspect there isn't actually a bug in the compiler. I suspect, it is doing exactly what you told it to do.

SemiHostedSyscall ();

has no arguments, no inputs and no outputs. If you need help writing C code, that's beyond the scope of this list. Briefly, to pass three arguments, you'd need:

   SemiHostedSyscall (fd, buf, nbytes);

Another way might be to put:

@item noinline
@cindex @code{noinline} function attribute
This function attribute prevents a function from being considered for
inlining.

on _write.

Reply via email to