libunwind-devel
[Top][All Lists]

## [libunwind] alloca()

 From: Johan Walles Subject: [libunwind] alloca() Date: Wed, 10 Dec 2003 17:34:24 +0100 User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

We have a (dynamically generated) function that uses a dynamic amount of user stack. The amount of stack used is a linear function of the parameters it is called with.
```
```
This is the same situation you'd have when unwinding through an ordinary C function using alloca(). What I'm wondering is, how do we tell libunwind this? Can we somehow tell libunwind that the user stack is modified by another register? Or do we just say that r42 contains the unmodified usp (see below)?
```
The relevant function is below.  R12 is adjusted dynamically at
0x2000000062738550.

Cheers //Johan

0x20000000627381d0:     [MII]       alloc r40=ar.pfs,24,16,0
0x20000000627381d1:                 mov r41=b0
0x20000000627381e0:     [MII]       nop.m 0x0
0x20000000627381e1:                 mov r43=pr
0x2000000062738201:                 ld8 r14=[r14]
0x2000000062738202:                 nop.i 0x0;;
0x2000000062738211:                 ld8 r15=[r15]
0x2000000062738212:                 nop.i 0x0;;
0x2000000062738220:     [MII]       mov r4=r15
0x2000000062738222:                 nop.i 0x0
0x2000000062738230:     [MMI]       ld8 r4=[r4]
0x2000000062738231:                 ld8 r5=[r5]
0x2000000062738240:     [MII]       ld4 r6=[r15]
0x2000000062738242:                 nop.i 0x0
0x2000000062738250:     [MMI]       ld8 r14=[r14];;
0x2000000062738252:                 nop.i 0x0;;
0x2000000062738260:     [MII]       st8 [r15]=r0
0x2000000062738262:                 nop.i 0x0
0x2000000062738270:     [MII]       st8 [r15]=r0
0x2000000062738272:                 nop.i 0x0
0x2000000062738280:     [MII]       st4 [r15]=r0
0x2000000062738281:                 shl r14=r36,3;;
0x2000000062738291:                 movl r14=0x1080238;;
0x20000000627382a1:                 ld8 r14=[r14]
0x20000000627382a2:                 nop.i 0x0;;
0x20000000627382b0:     [MIB]       nop.m 0x0
0x20000000627382b1:                 mov.sptk b6=r14,0x20000000627382b0
0x20000000627382b2:                 br.few b6
0x20000000627382c0:     [MMB]       ld8 r55=[r35],-8
0x20000000627382c1:                 nop.m 0x0
0x20000000627382c2:                 nop.b 0x0;;
0x20000000627382d0:     [MMB]       ld8 r54=[r35],-8
0x20000000627382d1:                 nop.m 0x0
0x20000000627382d2:                 nop.b 0x0;;
0x20000000627382e0:     [MMB]       ld8 r53=[r35],-8
0x20000000627382e1:                 nop.m 0x0
0x20000000627382e2:                 nop.b 0x0;;
0x20000000627382f0:     [MMB]       ld8 r52=[r35],-8
0x20000000627382f1:                 nop.m 0x0
0x20000000627382f2:                 nop.b 0x0;;
0x2000000062738300:     [MMB]       ld8 r51=[r35],-8
0x2000000062738301:                 nop.m 0x0
0x2000000062738302:                 nop.b 0x0;;
0x2000000062738310:     [MMB]       ld8 r50=[r35],-8
0x2000000062738311:                 nop.m 0x0
0x2000000062738312:                 nop.b 0x0;;
0x2000000062738320:     [MMB]       ld8 r49=[r35],-8
0x2000000062738321:                 nop.m 0x0
0x2000000062738322:                 nop.b 0x0;;
0x2000000062738330:     [MIB]       ld8 r48=[r35],-8
0x2000000062738331:                 nop.i 0x0
0x2000000062738332:                 nop.b 0x0
0x2000000062738340:     [MII]       nop.m 0x0
0x2000000062738341:                 shl r14=r38,3;;
0x2000000062738351:                 movl r14=0x1080288
0x2000000062738360:     [MII]       nop.m 0x0
0x2000000062738361:                 shl r15=r38,3;;
0x2000000062738370:     [MMI]       ld8 r14=[r14];;
0x2000000062738371:                 nop.m 0x0
0x2000000062738372:                 mov.sptk b6=r14,0x2000000062738370
0x2000000062738380:     [BBB]       br.few b6
0x2000000062738381:                 nop.b 0x0
0x2000000062738382:                 nop.b 0x0
0x2000000062738390:     [MIB]       nop.m 0x0
0x2000000062738391:                 tbit.z p6,p0=r39,7
0x2000000062738392:                 nop.b 0x0
0x20000000627383a0:     [MMI]       ldfd f15=[r37],-8;;
0x20000000627383a1:                 nop.m 0x0
0x20000000627383a2:                 nop.i 0x0
0x20000000627383b0:     [MFI]       nop.m 0x0
0x20000000627383b1:           (p06) fnorm.s.s0 f15=f15
0x20000000627383b2:                 nop.i 0x0
0x20000000627383c0:     [MIB]       nop.m 0x0
0x20000000627383c1:                 tbit.z p6,p0=r39,6
0x20000000627383c2:                 nop.b 0x0
0x20000000627383d0:     [MMI]       ldfd f14=[r37],-8;;
0x20000000627383d1:                 nop.m 0x0
0x20000000627383d2:                 nop.i 0x0
0x20000000627383e0:     [MFI]       nop.m 0x0
0x20000000627383e1:           (p06) fnorm.s.s0 f14=f14
0x20000000627383e2:                 nop.i 0x0
0x20000000627383f0:     [MIB]       nop.m 0x0
0x20000000627383f1:                 tbit.z p6,p0=r39,5
0x20000000627383f2:                 nop.b 0x0
0x2000000062738400:     [MMI]       ldfd f13=[r37],-8;;
0x2000000062738401:                 nop.m 0x0
0x2000000062738402:                 nop.i 0x0
0x2000000062738410:     [MFI]       nop.m 0x0
0x2000000062738411:           (p06) fnorm.s.s0 f13=f13
0x2000000062738412:                 nop.i 0x0
0x2000000062738420:     [MIB]       nop.m 0x0
0x2000000062738421:                 tbit.z p6,p0=r39,4
0x2000000062738422:                 nop.b 0x0
0x2000000062738430:     [MMI]       ldfd f12=[r37],-8;;
0x2000000062738431:                 nop.m 0x0
0x2000000062738432:                 nop.i 0x0
0x2000000062738440:     [MFI]       nop.m 0x0
0x2000000062738441:           (p06) fnorm.s.s0 f12=f12
0x2000000062738442:                 nop.i 0x0
0x2000000062738450:     [MIB]       nop.m 0x0
0x2000000062738451:                 tbit.z p6,p0=r39,3
0x2000000062738452:                 nop.b 0x0
0x2000000062738460:     [MMI]       ldfd f11=[r37],-8;;
0x2000000062738461:                 nop.m 0x0
0x2000000062738462:                 nop.i 0x0
0x2000000062738470:     [MFI]       nop.m 0x0
0x2000000062738471:           (p06) fnorm.s.s0 f11=f11
0x2000000062738472:                 nop.i 0x0
0x2000000062738480:     [MIB]       nop.m 0x0
0x2000000062738481:                 tbit.z p6,p0=r39,2
0x2000000062738482:                 nop.b 0x0
0x2000000062738490:     [MMI]       ldfd f10=[r37],-8;;
0x2000000062738491:                 nop.m 0x0
0x2000000062738492:                 nop.i 0x0
0x20000000627384a0:     [MFI]       nop.m 0x0
0x20000000627384a1:           (p06) fnorm.s.s0 f10=f10
0x20000000627384a2:                 nop.i 0x0
0x20000000627384b0:     [MIB]       nop.m 0x0
0x20000000627384b1:                 tbit.z p6,p0=r39,1
0x20000000627384b2:                 nop.b 0x0
0x20000000627384c0:     [MMI]       ldfd f9=[r37],-8;;
0x20000000627384c1:                 nop.m 0x0
0x20000000627384c2:                 nop.i 0x0
0x20000000627384d0:     [MFI]       nop.m 0x0
0x20000000627384d1:           (p06) fnorm.s.s0 f9=f9
0x20000000627384d2:                 nop.i 0x0
0x20000000627384e0:     [MIB]       nop.m 0x0
0x20000000627384e1:                 tbit.z p6,p0=r39,0
0x20000000627384e2:                 nop.b 0x0
0x20000000627384f0:     [MMI]       ldfd f8=[r37],-8;;
0x20000000627384f1:                 nop.m 0x0
0x20000000627384f2:                 nop.i 0x0
0x2000000062738500:     [MFI]       nop.m 0x0
0x2000000062738501:           (p06) fnorm.s.s0 f8=f8
0x2000000062738502:                 nop.i 0x0
0x2000000062738511:                 ld8 r15=[r14],8
0x2000000062738512:                 nop.i 0x0;;
0x2000000062738520:     [MMI]       ld4 r16=[r14];;
0x2000000062738521:                 nop.m 0x0
0x2000000062738522:                 shl r17=r16,3
0x2000000062738530:     [MBB]       cmp4.eq p6,p7=r0,r16
0x2000000062738531:           (p06) br.cond.dpnt.few 0x2000000062738580
0x2000000062738532:                 nop.b 0x0;;
0x2000000062738540:     [MII]       sub r18=r12,r17
0x2000000062738541:                 tbit.z p7,p6=r16,0;;
0x2000000062738551:                 nop.m 0x0
0x2000000062738552:                 nop.b 0x0;;
0x2000000062738560:     [MMI]       ld8 r19=[r15],8;;
0x2000000062738561:                 st8 [r18]=r19,8
0x2000000062738570:     [MBB]       cmp4.eq p6,p7=r0,r16
0x2000000062738571:           (p07) br.cond.dptk.few 0x2000000062738560
0x2000000062738572:                 nop.b 0x0
0x2000000062738580:     [MIB]       nop.m 0x0
0x2000000062738581:                 mov.sptk b6=r34,0x2000000062738580
0x2000000062738582:                 br.call.sptk.few b0=b6
0x2000000062738591:                 mov pr=r43,0xffffffffffffffc0
0x20000000627385a0:     [MMI]       ld8 r14=[r14];;
0x20000000627385a2:                 nop.i 0x0;;
0x20000000627385b0:     [MMI]       ld8 r15=[r15];;
0x20000000627385b1:                 mov r16=r15
0x20000000627385c0:     [MMI]       st8 [r16]=r4;;
0x20000000627385c1:                 st8 [r17]=r5
0x20000000627385d0:     [MII]       st8 [r15]=r33