On Wednesday 16 July 2008 10:31, David Greene wrote:> On Wednesday 16 July 2008 10:12, David Greene wrote:
> > I'm having some trouble using bugpoint with newer version of gcc
> > (bugpoint debug output below).
>
> I was using gcc 4.1.2. When I try 3.2.3 I get:
>
> bugpoint-test-program.bc.cbe.c:237: warning: conflicting types for built-in
> function `memcpy'
> bugpoint-test-program.bc.cbe.c: In function `main':
> bugpoint-test-program.bc.cbe.c:581: no vector mode with the size and type
> specified could be found
>
> and a bunch more vector errors.
>
> So I'm in a bit of a pickle. Does anyone know which versions of gcc
> understand the cbe output?
After hacking around in the CBE output I managed to compile it with
gcc, only to discover that gcc 4.1.2 has the SAME bug LLVM does with
respect to alignment. It is using a movapd where the address is NOT
aligned. So I can't generate correct code using CBE/gcc. Our C compiler
doesn't recognize gcc's vector intrinsics so I can't use CBE with
that.
I discovered that I can reproduce the problem with:
/ptmp/dag/universal_build/llvm-project/Debug/bin/opt -std-compile-opts -f -o
bugpoint-test-program.opt.bc bugpoint-test-program.bc
/ptmp/dag/universal_build/llvm-project/Debug/bin/llc -f -o
bugpoint-test-program.opt.bc.s bugpoint-test-program.opt.bc
ftn bugpoint-test-program.opt.bc.s (our Fortran compiler)
./a.out
If I remove -std-compile-opts, it passes.
I don't see a way to run opt directly with bugpoint. It seems to want to go
through the CBE, which has the problems I mentioned before (generating
syntactically-incorrect C).
If I pass -run-llc to bugpoint it seems to ignore optimization flags I give
it. Only running bugpoint with default options (which seems to be the
same as -run-cbe) seems to accept optimization flags.
What's the proper incantation to get bugpoint to run things through opt
but use llc to generate asm? As noted, CBE has issues generating
correct code so using it isn't an option right now.
-Dave