llvm linux/PPC cfrontend

Cyrille Mescam wrote:

Morning,

I would like to know if you received my mail with the assembly code
you wanted.

It not, i'll send it again to you.

Thanks for your help.

Regards.

Cyrille

I've looked into the files you sent me, and it seems that the problem is occuring due to the C library simplication pass (which is run by gccas). What appears to be happening is that a call to fprintf() is being changed to a call to fwrite(), but this transform is being done incorrectly because the fprintf() is being passed a ubyte * while fwrite() takes an sbyte *.

I'm creating a reduced testcase right now, but in the meantime, I'd like for you to try something. This should work around the problem that you're having (as well as verify that I understand the problem):

Go into your LLVM source tree and comment out the following line in llvm/tools/gccas/gccas.cpp:

addPass(PM, createSimplifyLibCallsPass()); // Library Call Optimizations

Rebuild gccas. Then, try to build the LLVM GCC frontend again. Please email the llvmdev list and let us know if it works.

In the meantime, I will continue to try to get a reduced test case and either fix the bug or hand it off to Reid (the author of the C library simplification pass).

-- John T.

Please file a PR for this. If noone else beats me to it, I will look into it tonight. However, feel free to beat me to it. :slight_smile:

-Chris

Chris Lattner wrote:

addPass(PM, createSimplifyLibCallsPass()); // Library Call Optimizations

Rebuild gccas. Then, try to build the LLVM GCC frontend again. Please email the llvmdev list and let us know if it works.

In the meantime, I will continue to try to get a reduced test case and either fix the bug or hand it off to Reid (the author of the C library simplification pass).

Please file a PR for this. If noone else beats me to it, I will look into it tonight. However, feel free to beat me to it. :slight_smile:

But of course. I'm just waiting for bugpoint to finishing chomping on it.
:slight_smile:

-Chris

-- John T.