This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/77308] surprisingly large stack usage for sha512 on arm
- From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 22 Aug 2016 06:09:19 +0000
- Subject: [Bug target/77308] surprisingly large stack usage for sha512 on arm
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
- References: <bug-77308-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77308
--- Comment #7 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
even more surprisingly is that:
While thumb2 code (-march=armv6t2 -mthumb) has about the same stack size
as arm code (-marm), thumb1 code has only 1588 bytes stack, and it does
not change with -fno-schedule-insns nor with the patch above:
arm-unknown-eabi-gcc -O3 -march=armv6 -msoft-float -mthumb -S sha512.c
=>
sha512_block_data_order:
push {r4, r5, r6, r7, lr}
mov r6, r10
mov r4, r8
mov r7, fp
mov r5, r9
ldr r3, .L11
push {r4, r5, r6, r7}
ldr r4, .L11+4
add sp, sp, r4
...
.L11:
.word 1580
.word -1588