From 089dea355a28da44376ce4f5195baa4b4e0b217d Mon Sep 17 00:00:00 2001 From: jiang <30155751@qq.com> Date: Sat, 3 May 2014 23:51:09 +0800 Subject: tcc on i386 are still having problems at work.Thank Roy report again. Struck on several variables can be connected to commit in the register. I am worried whether tcc can run the os. Since my machine is ubuntu 64 bits I can test my machine. --- tccgen.c | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) (limited to 'tccgen.c') diff --git a/tccgen.c b/tccgen.c index d504572..c2481b0 100644 --- a/tccgen.c +++ b/tccgen.c @@ -873,7 +873,7 @@ ST_FUNC int gv(int rc) #endif r = vtop->r & VT_VALMASK; - if((rc & ~RC_MASK) && (rc != RC_ST0)) + if(rc & ~RC_MASK) rc2 = ex_rc; else rc2 = (rc & RC_FLOAT) ? RC_FLOAT : RC_INT; @@ -2624,20 +2624,19 @@ ST_FUNC void vstore(void) vtop -=2; }else{ size = type_size(&vtop->type, &align); -#ifndef TCC_TARGET_X86_64 /* destination */ vswap(); vtop->type.t = VT_PTR; gaddrof(); /* address of memcpy() */ -# ifdef TCC_ARM_EABI +#ifdef TCC_ARM_EABI if(!(align & 7)) vpush_global_sym(&func_old_type, TOK_memcpy8); else if(!(align & 3)) vpush_global_sym(&func_old_type, TOK_memcpy4); else -# endif +#endif vpush_global_sym(&func_old_type, TOK_memcpy); vswap(); @@ -2646,22 +2645,8 @@ ST_FUNC void vstore(void) vtop->type.t = VT_PTR; gaddrof(); /* type size */ - vpushs(size); + vpushi(size); gfunc_call(3); -#else - /* destination */ - vswap(); - vtop->type.t = VT_PTR; - gaddrof(); - /* source */ - vpushv(vtop - 1); - vtop->type.t = VT_PTR; - gaddrof(); - /* size */ - vpushs(size); - struct_copy(&vtop[-2], &vtop[-1], &vtop[0]); - vtop -=3; -#endif } } else { vswap(); @@ -5354,22 +5339,16 @@ static void init_putz(CType *t, Section *sec, unsigned long c, int size) if (sec) { /* nothing to do because globals are already set to zero */ } else { -#ifndef TCC_TARGET_X86_64 vpush_global_sym(&func_old_type, TOK_memset); vseti(VT_LOCAL, c); -# ifdef TCC_TARGET_ARM +#ifdef TCC_TARGET_ARM vpushs(size); vpushi(0); -# else +#else vpushi(0); vpushs(size); -# endif - gfunc_call(3); -#else - vseti(VT_LOCAL, c); - gen_putz(vtop, size); - vtop--; #endif + gfunc_call(3); } } -- cgit v1.3.1