Displaying 4 results from an estimated 4 matches for "arg_ptr1".
Did you mean:
arg_ptr
2013 Feb 20
3
[LLVMdev] Is va_arg correct on Mips backend?
I didn't have Mips board. I compile as the commands and check the asm output as below.
1. Question:
The distance of caller arg[4] and arg[5] is 4 bytes. But the the callee get every
arg[] by 8 bytes offset (arg_ptr1+8 or arg_ptr2+8). I assume the #BB#4 and #BB#5 are the arg_ptr which is the pointer to access the stack arguments.
2. Question:
Stack memory 28($sp) has no initial value. If this memory address is a relocation record which set value by linker/loader, then it maybe is correct.
clang -c ch8_3.cpp...
2013 Feb 20
0
[LLVMdev] Is va_arg correct on Mips backend?
..., Jonathan <gamma_chen at yahoo.com.tw> wrote:
> I didn't have Mips board. I compile as the commands and check the asm
> output as below.
>
> 1. Question:
> The distance of caller arg[4] and arg[5] is 4 bytes. But the the callee
> get every
> arg[] by 8 bytes offset (arg_ptr1+8 or arg_ptr2+8). I assume the #BB#4
> and #BB#5 are the arg_ptr which is the pointer to access the stack
> arguments.
>
> 2. Question:
> Stack memory 28($sp) has no initial value. If this memory address is a
> relocation record which set value by linker/loader, then it maybe is...
2013 Feb 19
0
[LLVMdev] Is va_arg correct on Mips backend?
Which part of the generated code do you think is not correct? Could you be
more specific?
I compiled this program with clang and ran it on a mips board. It returns
the expected result (21).
On Tue, Feb 19, 2013 at 4:15 AM, Jonathan <gamma_chen at yahoo.com.tw> wrote:
> I check the Mips backend for the following C code fragment compile result.
> It seems not correct. Is it my
2013 Feb 19
2
[LLVMdev] Is va_arg correct on Mips backend?
I check the Mips backend for the following C code fragment compile result. It seems not correct. Is it my misunderstand or it's a bug.
//ch8_3.cpp
#include <stdarg.h>
int sum_i(int amount, ...)
{
int i = 0;
int val = 0;
int sum = 0;
va_list vl;
va_start(vl, amount);
for (i = 0; i < amount; i++)
{
val = va_arg(vl, int);
sum += val;
}
va_end(vl);