[Bug other/80492] Wrong code when unrolling a loop with inline asm and local regs
gjl at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Apr 23 07:28:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80492
--- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
FYI, if the code is not executed in a loop but instead
void do_syscalls_noloop (void)
{
syscall_7 (0, 8);
syscall_7 (1, 9);
syscall_7 (0, 8);
syscall_7 (1, 9);
}
then the generated code is as expected:
do_syscalls_noloop:
ldi r20,0 ; 5 *movhi/2 [length = 2]
ldi r21,0
ldi r24,lo8(8) ; 6 *movhi/5 [length = 2]
ldi r25,0
/* #APP */
/* SYSCALL_7 r20 r24 */
/* #NOAPP */
ldi r20,lo8(1) ; 8 *movhi/5 [length = 2]
ldi r21,0
ldi r24,lo8(9) ; 9 *movhi/5 [length = 2]
ldi r25,0
/* #APP */
/* SYSCALL_7 r20 r24 */
/* #NOAPP */
ldi r20,0 ; 11 *movhi/2 [length = 2]
ldi r21,0
ldi r24,lo8(8) ; 12 *movhi/5 [length = 2]
ldi r25,0
/* #APP */
/* SYSCALL_7 r20 r24 */
/* #NOAPP */
ldi r20,lo8(1) ; 14 *movhi/5 [length = 2]
ldi r21,0
ldi r24,lo8(9) ; 15 *movhi/5 [length = 2]
ldi r25,0
/* #APP */
/* SYSCALL_7 r20 r24 */
/* #NOAPP */
ret ; 22 return [length = 1]
More information about the Gcc-bugs
mailing list