summaryrefslogtreecommitdiff
path: root/frontends/ast/simplify.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-11-04 21:29:36 +0100
committerClifford Wolf <clifford@clifford.at>2013-11-04 21:29:36 +0100
commitf2786df1468c10ab9b845787b0b16732e26e9556 (patch)
treebfc11c25ef4bcef483b01ab0c1cdd04c5064ac84 /frontends/ast/simplify.cc
parent31ddf7b9d47f12f3344385de2f861dbf1fd87440 (diff)
Another fix for early width and sign detection in ast simplifier
Diffstat (limited to 'frontends/ast/simplify.cc')
-rw-r--r--frontends/ast/simplify.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index 643855d0..81812a40 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -191,8 +191,9 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
case AST_ASSIGN:
while (children[0]->simplify(false, false, true, stage, -1, false) == true) { }
while (children[1]->simplify(false, false, false, stage, -1, false) == true) { }
- children[0]->detectSignWidth(width_hint, backup_sign_hint);
- children[1]->detectSignWidth(backup_width_hint, sign_hint);
+ children[0]->detectSignWidth(backup_width_hint, backup_sign_hint);
+ children[1]->detectSignWidth(width_hint, sign_hint);
+ width_hint = std::max(width_hint, backup_width_hint);
child_0_is_self_determined = true;
break;