https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86011
--- Comment #2 from Patrick Oppenlander <patrick at motec dot com.au> ---
Sure,
# cat test.c
struct foo { long a, b; };
struct foo test(long long x)
{
return (struct foo){x / 77, x % 77};
}
# gcc --version
gcc (GCC) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# gcc -c -O2 test.c
# objdump -d test.o
test.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <test>:
0: e92d40d0 push {r4, r6, r7, lr}
4: e1a06002 mov r6, r2
8: e1a07003 mov r7, r3
c: e1a04000 mov r4, r0
10: e3a0204d mov r2, #77 ; 0x4d
14: e3a03000 mov r3, #0
18: e1a00006 mov r0, r6
1c: e1a01007 mov r1, r7
20: ebfffffe bl 0 <__aeabi_ldivmod>
24: e1a01007 mov r1, r7
28: e3a0204d mov r2, #77 ; 0x4d
2c: e3a03000 mov r3, #0
30: e5840000 str r0, [r4]
34: e1a00006 mov r0, r6
38: ebfffffe bl 0 <__aeabi_ldivmod>
3c: e1a00004 mov r0, r4
40: e5842004 str r2, [r4, #4]
44: e8bd80d0 pop {r4, r6, r7, pc}
Looks like the same problem is still there.