diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-30 14:34:34 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-09-06 02:57:20 +0200 |
| commit | 4d4dc74a9afa3e11953d7ff230794c83472e60c0 (patch) | |
| tree | 0bb6e86a2ba4647ee4645f7577f35d73dcc162cc /linearize.c | |
| parent | 45c5f24a17690d2d4276fadb6c02a78e44843b23 (diff) | |
| download | sparse-dev-4d4dc74a9afa3e11953d7ff230794c83472e60c0.tar.gz | |
fix ordering of phi-node operand
The linearization of logical '&&' create a phi-node with its
operands in the wrong order relatively to the parent BBs.
Switch the order of the operands for logical '&&'.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'linearize.c')
| -rw-r--r-- | linearize.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linearize.c b/linearize.c index a56c272f..bdcb92c1 100644 --- a/linearize.c +++ b/linearize.c @@ -1721,13 +1721,13 @@ static pseudo_t linearize_logical(struct entrypoint *ep, struct expression *expr } else { pseudo_t src1; - phi2 = alloc_phi(ep->active, value_pseudo(0), expr->ctype); + phi1 = alloc_phi(ep->active, value_pseudo(0), expr->ctype); linearize_cond_branch(ep, expr->left, other, merge); set_activeblock(ep, other); src1 = linearize_expression_to_bool(ep, expr->right); src1 = cast_pseudo(ep, src1, &bool_ctype, expr->ctype); - phi1 = alloc_phi(ep->active, src1, expr->ctype); + phi2 = alloc_phi(ep->active, src1, expr->ctype); } set_activeblock(ep, merge); |
