On 2015-07-25 15:06, Richard Henderson wrote:
> On 07/24/2015 04:34 PM, Aurelien Jarno wrote:
> >          ots->val_type = TEMP_VAL_CONST;
> >          ots->val = ts->val;
> >+        if (IS_DEAD_ARG(1)) {
> >+            temp_dead(s, args[1]);
> >+        }
> 
> Aren't we also missing
> 
>   if (NEED_SYNC_ARG(0)) {
>     temp_sync(s, args[0], allocated_regs);
>   }
> 
> along this path?

I don't think so, I guess it's covered by the first part of this
function:

|    if (((NEED_SYNC_ARG(0) || ots->fixed_reg) && ts->val_type != TEMP_VAL_REG)
|        || ts->val_type == TEMP_VAL_MEM) {

It means after this block, a value that need to be synced will always
be in a register, including in the constant case.

> Seems like there's room for cleanup here, at least for 2.5...

I agree we might want to clean a bit the code. It might even go
beyond this function, as we repeatedly have almost the same code in
various places of tcg.c. For example we can imagine a function "move
this temp whatever it is (mem, const, reg) in this register". If we
declare it inline, we can leave the compiler do the few optimizations
we have done.

But indeed that's for 2.5.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurel...@aurel32.net                 http://www.aurel32.net

Reply via email to