riscv: Fix stdarg_many_test
if named params are passed on stack, the va_arg area begins after that, not at sp+0. Fixes abitest:stdarg_many_test.
This commit is contained in:
		
							parent
							
								
									e9c2a1996a
								
							
						
					
					
						commit
						98dc4c123d
					
				
					 2 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
					@ -576,7 +576,7 @@ ST_FUNC void gfunc_call(int nb_args)
 | 
				
			||||||
      EI(0x13, 0, 2, 2, stack_adj + tempspace);      // addi sp, sp, adj
 | 
					      EI(0x13, 0, 2, 2, stack_adj + tempspace);      // addi sp, sp, adj
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int func_sub_sp_offset, num_va_regs;
 | 
					static int func_sub_sp_offset, num_va_regs, func_va_list_ofs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ST_FUNC void gfunc_prolog(CType *func_type)
 | 
					ST_FUNC void gfunc_prolog(CType *func_type)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -650,6 +650,7 @@ ST_FUNC void gfunc_prolog(CType *func_type)
 | 
				
			||||||
                 (byref ? VT_LLOCAL : VT_LOCAL) | lvalue_type(sym->type.t),
 | 
					                 (byref ? VT_LLOCAL : VT_LOCAL) | lvalue_type(sym->type.t),
 | 
				
			||||||
                 param_addr);
 | 
					                 param_addr);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    func_va_list_ofs = addr;
 | 
				
			||||||
    num_va_regs = 0;
 | 
					    num_va_regs = 0;
 | 
				
			||||||
    if (func_type->ref->f.func_type == FUNC_ELLIPSIS) {
 | 
					    if (func_type->ref->f.func_type == FUNC_ELLIPSIS) {
 | 
				
			||||||
        for (; aireg < 8; aireg++) {
 | 
					        for (; aireg < 8; aireg++) {
 | 
				
			||||||
| 
						 | 
					@ -749,7 +750,8 @@ ST_FUNC void gfunc_epilog(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ST_FUNC void gen_va_start(void)
 | 
					ST_FUNC void gen_va_start(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    tcc_error("implement me: %s", __FUNCTION__);
 | 
					    vtop--;
 | 
				
			||||||
 | 
					    vset(&char_pointer_type, VT_LOCAL, func_va_list_ofs);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ST_FUNC void gen_va_arg(CType *t)
 | 
					ST_FUNC void gen_va_arg(CType *t)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										4
									
								
								tccgen.c
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								tccgen.c
									
										
									
									
									
								
							| 
						 | 
					@ -5180,9 +5180,7 @@ ST_FUNC void unary(void)
 | 
				
			||||||
            r = VT_LOCAL;
 | 
					            r = VT_LOCAL;
 | 
				
			||||||
        if (r != VT_LOCAL)
 | 
					        if (r != VT_LOCAL)
 | 
				
			||||||
            tcc_error("__builtin_va_start expects a local variable");
 | 
					            tcc_error("__builtin_va_start expects a local variable");
 | 
				
			||||||
        vtop->r = r;
 | 
					        gen_va_start();
 | 
				
			||||||
	vtop->type = char_pointer_type;
 | 
					 | 
				
			||||||
	vtop->c.i = 0;
 | 
					 | 
				
			||||||
	vstore();
 | 
						vstore();
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue