aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/compat
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-06-16 08:31:50 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-06-21 11:28:40 +0200
commit852801f8b966407544326cd1c485f9bc7681a2e6 (patch)
tree2371a2168b9c6c7a343860d2e27331753d3a4514 /compat
parentd79853389f55e3645e4a094f091915ea63546d09 (diff)
downloadsparse-dev-852801f8b966407544326cd1c485f9bc7681a2e6.tar.gz
fix: try_to_simplify_bb eargerness
The simplification done by try_to_simplify_bb() (essentially trying to bypass a basic block containing a conditional branch if the branch is controlled by an OP_PHI when the corresponding OP_PHISRC is a constant) can only be done if some conditions are met: 1) The basic block doesn't have some side effects (in which case it must not be bypassed). Checked by bb_has_side_effects(). 2) There may be some pseudos defined in the basic block but no basic blocks may depend on them. Checked by bb_depends_on(). The second condition is efficiently checked using liveness information. However, there is no liveness information done for OP_PHI/OP_PHISRC. So if the basic block contains some other OP_PHI than the controlling one, there will surely be some other BB depending on it but this will not be reflected in the liveness info and bb_depends_on() can then wrongly report that no dependencies exist. Fix this by adding an extra check, verifiying that no other OP_PHI are defined in the BB and avoiding the simplification otherwise. Reported-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'compat')
0 files changed, 0 insertions, 0 deletions