From ce3e1f0183f031c085f50b8714e4ae48cf045354 Mon Sep 17 00:00:00 2001
From: clc5q <clc5q@git.zephyr-software.com>
Date: Tue, 18 Mar 2014 18:26:32 +0000
Subject: [PATCH] Propagate MEDS type NUMERIC from DEFs to USEs of sign- and
 zero-extended moves.

---
 SMPInstr.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/SMPInstr.cpp b/SMPInstr.cpp
index 76474b8e..e7fdc011 100644
--- a/SMPInstr.cpp
+++ b/SMPInstr.cpp
@@ -6005,6 +6005,7 @@ bool SMPInstr::InferOperatorType(SMPRegTransfer *CurrRT) {
 			}
 			break;
 
+#if 0
 		case SMP_SIGN_EXTEND:
 		case SMP_ZERO_EXTEND:
 			// Should we infer that all operands are NUMERIC?  !!!???!!!!
@@ -6013,6 +6014,7 @@ bool SMPInstr::InferOperatorType(SMPRegTransfer *CurrRT) {
 				updated = true;
 			}
 			break;
+#endif
 
 		case SMP_ADDRESS_OF: // take effective address
 			if (UNINIT == CurrRT->GetOperatorType()) {
@@ -6023,6 +6025,8 @@ bool SMPInstr::InferOperatorType(SMPRegTransfer *CurrRT) {
 			}
 			break;
 
+		case SMP_SIGN_EXTEND:
+		case SMP_ZERO_EXTEND:
 		case SMP_U_LEFT_SHIFT: // unsigned left shift
 		case SMP_S_LEFT_SHIFT: // signed left shift
 		case SMP_U_RIGHT_SHIFT: // unsigned right shift
@@ -6105,6 +6109,7 @@ bool SMPInstr::InferOperatorType(SMPRegTransfer *CurrRT) {
 #if SMP_AGGRESSIVE_TYPE_INFERENCE
 				if (UNINIT == CurrRT->GetRightTree()->GetOperatorType()) {
 					CurrRT->GetRightTree()->SetOperatorType(NUMERIC, this);
+					updated = true;
 				}
 #endif
 				updated |= this->InferOperatorType(CurrRT->GetRightTree());
-- 
GitLab