glsl/opt_cpe: Fix a crash when a kill kills for two reasons.

Fixes glsl-copy-propagation-loop-2 when this optimization pass is
re-enabled.

Reported-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
Eric Anholt 2011-04-08 07:54:50 -10:00
parent 487debfda5
commit 909bd476ca

View file

@ -390,8 +390,10 @@ ir_copy_propagation_elements_visitor::kill(kill_entry *k)
if (entry->lhs == k->var) {
entry->write_mask = entry->write_mask & ~k->write_mask;
if (entry->write_mask == 0)
if (entry->write_mask == 0) {
entry->remove();
continue;
}
}
if (entry->rhs == k->var) {
entry->remove();