Problem with zero extend from BI to SI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

I have a problem with zero extension from BI mode into SI mode.
I try to compile following piece of code:

_Bool check_test(int a, int b)
{
_Bool check =  (a > b) ;
return(check) ;
}

The description is such that it puts the _Bool check flag in the Condition Code register.
This is a 16-bit register file in the machine that handles booleans.
The calling convention of the machine returns the return value in register 32. To do this operation, a sign extend from the boolean (BI) check to the int (SI) R20 needs to be done. When I run the code through the compiler, after the expand step,
I get following:

file : check_test2.c.233r.expand

<preceding INSNs putting the result into check>

(insn 10 9 11 2 (set (reg:QI 79 [ check ])
        (reg:BI 81)) "check_test2.c":3:7 -1
     (nil))
(insn 11 10 12 2 (set (reg:SI 82)
        (zero_extend:SI (reg:QI 79 [ check ]))) "check_test2.c":4:7 -1
     (nil))
(insn 12 11 16 2 (set (reg/v:SI 74 [ <retval> ])
        (reg:SI 82)) "check_test2.c":4:7 -1
     (nil))

The first insn of this list is not consistent. I mean, as far as I understand it, it should be a zero_extend and not a set. The use of the set creates all kinds of problems, because there are part of the infrastructure that do not allow a
set from BI to QI mode.
Is this a bug or what ?. I mean, I have seen code in cfexpand.c that derives the operand to use from the size of the type, counted in bytes, and I guess both BI and QI are one byte, so does it then "forget" the expand ?.

Best Regards,

Henri.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux