http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61128
Bug ID: 61128 Summary: [cr16] Incorrect code generated for udivmodsi4 Product: gcc Version: 4.10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: stefan at astylos dot dk Target: cr16 Created attachment 32769 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32769&action=edit Preprocessed source When a cr16 crosscompiler builds gcc, the return sequence of udivmodsi4 looks like this: ... movw r2, r0 movw r3, r1 cmpw $0, r6 bne .L10 movw ra, r0 movw ra, r1 .L10: pop $1, r7 popret ra The last two movw instructions tries to move the 32 bits in ra to the pair of 16 bit registers r0 and r1, but this will only move the low order 16 bits to both of them. This should probably be a 'movd (ra),(r1,r0)' instruction instead. This is in 4.8, 4.9 and current trunk. Configuration options: --target=cr16-none-elf --enable-languages=c --without-headers --disable-libssp