The issue here is that we are in inconsistent state when optimizing
redundancies and thus fail to look up an existing element. Later
when the stmt is updated on removing elements from the hashtable
we remove the wrong one. Oops.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
Richard.
2009-10-09 Richard Guenther<rguenther@suse.de>
PR tree-optimization/41634
* tree-ssa-dom.c (remove_local_expressions_from_table): Assert
we remove the correct elements.
(optimize_stmt): Make sure to update stmt operands before
optimizing redundancies.
* gcc.c-torture/compile/pr41634.c: New testcase.