This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug go/66870] split stack issues on ppc64le and ppc64


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66870

--- Comment #10 from boger at us dot ibm.com ---
Now that I am building on ppc64 with a new enough glibc, using my latest
patches for rs6000.c and Andreas' patch, and forcing the gold linker to be
used, I am hitting a testcase failure in the libgo fmt test.  

The failure is a segv, gdb shows this:

   0x10024aa0 <fmt.free.pN6_fmt.ss>:    ld      r0,-28736(r13)
   0x10024aa4 <fmt.free.pN6_fmt.ss+4>:  addi    r12,r1,-160
   0x10024aa8 <fmt.free.pN6_fmt.ss+8>:  nop
   0x10024aac <fmt.free.pN6_fmt.ss+12>: cmpld   cr7,r12,r0
   0x10024ab0 <fmt.free.pN6_fmt.ss+16>: blt-    cr7,0x10024b78
<fmt.free.pN6_fmt.ss+216>
   0x10024ab4 <fmt.free.pN6_fmt.ss+20>: rldicl. r9,r4,8,56
=> 0x10024ab8 <fmt.free.pN6_fmt.ss+24>: std     r4,56(r12)
   0x10024abc <fmt.free.pN6_fmt.ss+28>: std     r5,64(r12)
   0x10024ac0 <fmt.free.pN6_fmt.ss+32>: std     r6,72(r12)
   0x10024ac4 <fmt.free.pN6_fmt.ss+36>: std     r7,80(r12)

r12 does not contain the correct value.  If look below in this function where
the call to __morestack was, I see this:

0x10024b78 <fmt.free.pN6_fmt.ss+216>:   mflr    r0
   0x10024b7c <fmt.free.pN6_fmt.ss+220>:        std     r0,16(r1)
   0x10024b80 <fmt.free.pN6_fmt.ss+224>:        bl      0x1004ed18
<.__morestack>
   0x10024b84 <fmt.free.pN6_fmt.ss+228>:        ld      r0,16(r1)
   0x10024b88 <fmt.free.pN6_fmt.ss+232>:        mtlr    r0
   0x10024b8c <fmt.free.pN6_fmt.ss+236>:        blr
   0x10024b90 <fmt.free.pN6_fmt.ss+240>:        b       0x10024ab4
<fmt.free.pN6_fmt.ss+20>

For it to get to the code where the segv occurs, it must have taken the last
branch after the call to __morestack.  In reading the comments in the emit
prologue code in rs6000.c, it says that __morestack returns the value in r29
and that should be moved to r12, but I don't see that happening in this code.

Alan, can you look at this? I will send you the details on where it is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]