public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/64379] New: VFP register restore in ARM epilogue can break indirect tailcalls
@ 2014-12-22 22:20 donn.seeley at windriver dot com
  2014-12-22 22:21 ` [Bug c/64379] " donn.seeley at windriver dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: donn.seeley at windriver dot com @ 2014-12-22 22:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64379
           Summary: VFP register restore in ARM epilogue can break
                    indirect tailcalls
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: donn.seeley at windriver dot com

Created attachment 34314
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34314&action=edit
reduced from content.c in xfsdump

In the example, the compiler uses a VFP/NEON register to hold a 64-bit scalar. 
Restoring the saved VFP/NEON register from the stack stomps on IP.  But the
indirect tailcall uses all 4 argument registers, so the function pointer is in
IP, which got trashed:

        sub     ip, fp, #44
        fldmfdd ip!, {d8}
        sub     sp, fp, #36
        ldmfd   sp, {r4, r5, r6, r7, r8, r9, fp, sp, lr}
        bx      ip      @ indirect register sibling call

The code branches to a stack location and the program segfaults.


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-01-14 10:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-22 22:20 [Bug c/64379] New: VFP register restore in ARM epilogue can break indirect tailcalls donn.seeley at windriver dot com
2014-12-22 22:21 ` [Bug c/64379] " donn.seeley at windriver dot com
2014-12-22 22:22 ` [Bug target/64379] " donn.seeley at windriver dot com
2014-12-23  0:15 ` donn.seeley at windriver dot com
2014-12-23  9:33 ` mikpelinux at gmail dot com
2014-12-23 15:39 ` mikpelinux at gmail dot com
2014-12-23 15:49 ` donn.seeley at windriver dot com
2015-01-13 15:12 ` ramana at gcc dot gnu.org
2015-01-13 16:05 ` ebotcazou at gcc dot gnu.org
2015-01-13 16:16 ` ramana at gcc dot gnu.org
2015-01-13 16:27 ` ebotcazou at gcc dot gnu.org
2015-01-13 21:06 ` donn.seeley at windriver dot com
2015-01-13 21:09 ` donn.seeley at windriver dot com
2015-01-14  8:33 ` ramana at gcc dot gnu.org
2015-01-14 10:19 ` ebotcazou at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).