diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp index f93195625b81..aecb25ce0d6d 100644 --- a/lib/CodeGen/PrologEpilogInserter.cpp +++ b/lib/CodeGen/PrologEpilogInserter.cpp @@ -680,7 +680,8 @@ void PEI::insertPrologEpilogCode(MachineFunction &Fn) { // we've been asked for it. This, when linked with a runtime with support // for segmented stacks (libgcc is one), will result in allocating stack // space in small chunks instead of one large contiguous block. - if (Fn.getTarget().Options.EnableSegmentedStacks) + if (Fn.getTarget().Options.EnableSegmentedStacks && + !Fn.getFunction()->hasFnAttribute("no-split-stack")) TFI.adjustForSegmentedStacks(Fn); // Emit additional code that is required to explicitly handle the stack in