From a586bfd1ecd6bb7e795a8d60651d9937b764bc3d Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 26 Jun 2013 21:26:45 -0700 Subject: [PATCH] When finding the canonical address use a signed expression if needed. --- netmisc.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/netmisc.cc b/netmisc.cc index 5a09029a6..6eec50421 100644 --- a/netmisc.cc +++ b/netmisc.cc @@ -629,8 +629,11 @@ NetExpr* normalize_variable_unpacked(const NetNet*net, list&indices) if (canonical_expr == 0) { canonical_expr = tmp_scaled; } else { + bool expr_has_sign = canonical_expr->has_sign() && + tmp_scaled->has_sign(); canonical_expr = new NetEBAdd('+', canonical_expr, tmp_scaled, - canonical_expr->expr_width()+1, false); + canonical_expr->expr_width()+1, + expr_has_sign); } }