[thumb2, size] allocate local variables with fewer instructions

Bug #637220 reported by Yao Qi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
New
Undecided
Unassigned

Bug Description

GCC PR40657 is about this kind of problem, and was fixed. However, we can find similar problem when build toolchain with hard float.
Compiled test case like this,
$ arm-none-linux-gnueabi-gcc -Os -
fno-common -c -mthumb -mcpu=cortex-a9 -mfpu=neon -Os -fno-common -mfloat-abi=hard -S extral_sp_sub.c,

GCC generates code like this,
00000000 <diffmeasure>:
   0: b570 push {r4, r5, r6, lr}
   2: 2400 movs r4, #0
   4: ed2d 8b04 vpush {d8-d9}
   8: b082 sub sp, #8
...
  b0: b002 add sp, #8
  b2: ecbd 8b04 vpop {d8-d9}
  b6: bd70 pop {r4, r5, r6, pc}

This code sequence can be improved like this,
push {r2, r3, r4, r5, lr}
movs r4, #0
vpush {d8-d9}
...
vpop {d8-d9}
pop {r2, r3, r4, r5, pc}
 so, sub and add instruction to sp can be removed.

Tags: size task
Revision history for this message
Yao Qi (yao-codesourcery) wrote :
Michael Hope (michaelh1)
tags: added: size task
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.