From 35ec9062cfbf95ff41660f0a70d70acc0ddcda18 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 29 Sep 2023 18:39:33 +0900 Subject: [PATCH] [qfcc] Find the dagged expression for scales I'd missed this in the previous commit, which was a good thing, really, as it turns out this was the trigger of the bug that causes my fancy zero test to become non-zero. It seems the bug is in either component_sum or in the extend merging. --- tools/qfcc/source/expr_algebra.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/qfcc/source/expr_algebra.c b/tools/qfcc/source/expr_algebra.c index a3c1e030d..bd4016b79 100644 --- a/tools/qfcc/source/expr_algebra.c +++ b/tools/qfcc/source/expr_algebra.c @@ -752,6 +752,8 @@ static const expr_t * apply_scale (type_t *type, const expr_t *expr, const expr_t *prod) { if (expr && prod) { + expr = fold_constants (expr); + expr = edag_add_expr (expr); expr = scale_expr (type, expr, prod); } return expr;