LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 45345 - Bad codegen: funclet Prologue and Epilogue do not agree on frame size.
Summary: Bad codegen: funclet Prologue and Epilogue do not agree on frame size.
Status: NEW
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: AArch64 (show other bugs)
Version: 9.0
Hardware: PC Windows NT
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-29 09:29 PDT by Daniel Frampton
Modified: 2020-03-29 09:44 PDT (History)
4 users (show)

See Also:
Fixed By Commit(s):


Attachments
Program that will crash if compiled and run on aarch64-pc-windows-msvc (288 bytes, text/plain)
2020-03-29 09:29 PDT, Daniel Frampton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Frampton 2020-03-29 09:29:37 PDT
Created attachment 23288 [details]
Program that will crash if compiled and run on aarch64-pc-windows-msvc

The generated code for a funclet can have an add to sp in the epilogue for which there is no corresponding sub in the prologue.

To trigger this case we must be generating a funclet and:

1) The function must make a call where arguments are passed on the stack (these are the extra bytes the epilog adds).

2) We must not be able to combine the stack adjustment into a single sub to sp when saving callee-save registers, which will happen if we have an aligned object or are using alloca.

Attaching simple C++ repro.

Bug exists in both LLVM9 and master.
Comment 1 Daniel Frampton 2020-03-29 09:44:17 PDT
See https://reviews.llvm.org/D77015