hi, llvm-gcc deal with va_arg() by word alignment.

hi,
I am porting llvm to our embedded cpu.
By my abi, long long type is aligned by 8 bytes.
But now llvm-gcc frontend follows x86 abi, generate
word-alignment LLVM-IR for va_arg().

In some degree, llvm-gcc frontend depends on targets.
The best solution is llvm-gcc can create va_arg node,
I can lower it at the backend.

Who can give a temporary solution to make frontend can
create 8 byte alignment code for long long type?

Thanks

renkun.
|

Is your llvm-gcc frontend targeting x86? It does not generate target neutral bitcode.

Evan

Hi,

     I am porting llvm to our embedded cpu.
By my abi, long long type is aligned by 8 bytes.
But now llvm-gcc frontend follows x86 abi, generate
word-alignment LLVM-IR for va_arg().

if llvm-gcc thinks the alignment is 4 but it is not then you
will get more problems than just with va_arg. Why not teach
llvm-gcc about your target?

Ciao,

Duncan.