aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2017-09-05 13:27:58 +0000
committerWilco Dijkstra <wilco@gcc.gnu.org>2017-09-05 13:27:58 +0000
commitae85ad3a95d6df3c4131d02fd327809a29d10b33 (patch)
tree7280c7e1c75597c2c29f62ff781b46e1369249c9 /gcc/builtins.c
parent54c430044ba9a35a590e591108b184535eba5763 (diff)
downloadgcc-ae85ad3a95d6df3c4131d02fd327809a29d10b33.zip
gcc-ae85ad3a95d6df3c4131d02fd327809a29d10b33.tar.gz
gcc-ae85ad3a95d6df3c4131d02fd327809a29d10b33.tar.bz2
Improve alloca alignment
This patch improves alloca alignment. Currently alloca reserves too much space as it aligns twice, and generates unnecessary stack alignment code. When the requested alignment is lower than the stack alignment, no extra alignment is needed. If the requested alignment is higher, we need to increase the size by the difference of the requested alignment and the stack alignment. As a result, the alloca alignment is exactly as expected: alloca (16): sub sp, sp, #16 mov x1, sp alloca (x): add x0, x0, 15 and x0, x0, -16 sub sp, sp, x0 mov x0, sp __builtin_alloca_with_align (x, 512): add x0, x0, 63 and x0, x0, -16 sub sp, sp, x0 add x0, sp, 63 and x0, x0, -64 gcc/ * explow.c (get_dynamic_stack_size): Improve dynamic alignment. From-SVN: r251713
Diffstat (limited to 'gcc/builtins.c')
0 files changed, 0 insertions, 0 deletions