PR target/109402: v850 (not v850e) variant of __muldi3() moves sp in reversed directi...
authorTetsuma Hoshino <t-hoshino@pony-e.jp>
Sat, 8 Apr 2023 14:19:53 +0000 (08:19 -0600)
committerJeff Law <jlaw@ventanamicro>
Sat, 8 Apr 2023 14:26:00 +0000 (08:26 -0600)
muldi3 will deallocate stack space after the call to __save_r26_r31,
then re-allocate the space a short while later.  If an interrupt
occurs in that window, it can clobber items on the stack.

PR target/109402

libgcc/
* config/v850/lib1funcs.S (___muldi3): Remove unnecessary
stack manipulations.

libgcc/config/v850/lib1funcs.S

index 20fa499..35b5ab5 100644 (file)
@@ -2211,7 +2211,6 @@ ___ucmpdi2:
 ___muldi3:
 #ifdef __v850__
         jarl  __save_r26_r31, r10
-        addi  16,  sp, sp
         mov   r6,  r28
         shr   15,  r28
         movea lo(32767), r0, r14
@@ -2256,7 +2255,6 @@ ___muldi3:
         mulh  r12, r6
         mov   r28,  r17
         mulh  r10, r17
-        add   -16, sp
         mov   r28,  r12
         mulh  r8,  r12
         add   r17, r18