From db548ffcbdc37dfde3e1a5dcd860ad13e66baa7c Mon Sep 17 00:00:00 2001
From: clc5q <clc5q@git.zephyr-software.com>
Date: Sun, 17 Jan 2016 01:53:14 +0000
Subject: [PATCH] Add debugging output for AnalyzeStackPointerDeltas().

Former-commit-id: 989e91b7eb2b735b37756bf7181a092a706467c8
---
 src/base/SMPFunction.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/base/SMPFunction.cpp b/src/base/SMPFunction.cpp
index 3ebaaa8d..8213a5c7 100644
--- a/src/base/SMPFunction.cpp
+++ b/src/base/SMPFunction.cpp
@@ -1392,6 +1392,10 @@ bool SMPFunction::AnalyzeStackPointerDeltas(void) {
 					CurrBlock->SetProcessed(false);
 					ReprocessingAllocaBlocks = true;
 					DeltaIncrement = IncomingDelta - PrevIncomingDelta;
+					if (0 != (DeltaIncrement % 32)) { // 32 bytes is our alloca fudge increment
+						SMP_msg("WARNING: DeltaIncrement of %d not alloca multiple for block at %llx\n",
+							(unsigned long long) CurrBlock->GetFirstAddr());
+					}
 					continue;  // Make the loop come around and process this block again, using
 							   //  the new incoming delta. Because we do this only when it decreases
 							   //  the stack size as seen by this block, no infinite loop is possible.
@@ -1582,6 +1586,9 @@ bool SMPFunction::AnalyzeStackPointerDeltas(void) {
 						WorkList.clear();
 						break;
 					}
+					if (TraceFlag) {
+						SMP_msg("TRACE: CurrentDelta is %d at %llx\n", CurrentDelta, (unsigned long long) InstAddr);
+					}
 					SMPitype FlowType = CurrInst->GetDataFlowType();
 					IncomingDelta += CurrentDelta;
 					if ((RETURN == FlowType) && (!CurrInst->IsCondTailCall()) && (!CurrInst->IsTailCall())) {
-- 
GitLab