When a function return type is "unsigned char", the return value is sign extended by "MOV" instruction. It should be "MOVU" instruction.
ex) unsigned char uA; unsigned char func() { return uA; } NG) _func: mov.L #_uA, r14 mov.B [r14], r1 rts .size _func, .-_func .comm _uA,1,4 -- Summary: RX signed extened unsigned char or short return value. Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kazuhiro dot inaoka dot ud at renesas dot com GCC build triplet: i686-linux GCC host triplet: i686-linux GCC target triplet: rx-elf http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45000