+2015-10-06 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/67859
+ * tree-ssa-pre.c (create_expression_by_pieces): Properly
+ discard not inserted stmts.
+
2015-10-06 Jonathan Wakely <jwakely@redhat.com>
* doc/extend.texi (Template Instantiation): Reorder options and
+2015-10-06 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/67859
+ * gcc.dg/torture/pr67859.c: New testcase.
+
2015-10-05 Kirill Yukhin <kirill.yukhin@intel.com>
* gcc.target/i386/builtin_target.c: Add check for AES and PCLMUL.
folded = gimple_convert (&forced_stmts, exprtype, folded);
- /* If everything simplified to an exisiting SSA name or constant just
- return that. */
- if (gimple_seq_empty_p (forced_stmts)
- || is_gimple_min_invariant (folded))
+ /* If there is nothing to insert, return the simplified result. */
+ if (gimple_seq_empty_p (forced_stmts))
return folded;
+ /* If we simplified to a constant return it and discard eventually
+ built stmts. */
+ if (is_gimple_min_invariant (folded))
+ {
+ gimple_seq_discard (forced_stmts);
+ return folded;
+ }
gcc_assert (TREE_CODE (folded) == SSA_NAME);