}
/* Now, check if we did a whole-variable assignment. */
- if (always_assign && (ir->lhs->whole_variable_referenced() != NULL)) {
+ if (always_assign && (ir->whole_variable_written() != NULL)) {
/* We did a whole-variable assignment. So, any instruction in
* the assignment list with the same LHS is dead.
*/
}
}
- /* Add this instruction to the assignment list. */
+ /* Add this instruction to the assignment list available to be removed.
+ * But not if the assignment has other side effects.
+ */
+ if (ir_has_call(ir))
+ return progress;
+
assignment_entry *entry = new(ctx) assignment_entry(var, ir);
assignments->push_tail(entry);