2014-01-14  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/58921
	PR tree-optimization/59006
	* tree-vect-loop-manip.c (vect_loop_versioning): Remove code
	hoisting invariant stmts.
	* tree-vect-stmts.c (vectorizable_load): Insert the splat of
	invariant loads on the preheader edge if possible.

	* gcc.dg/torture/pr58921.c: New testcase.
	* gcc.dg/torture/pr59006.c: Likewise.
	* gcc.dg/vect/pr58508.c: XFAIL no longer handled cases.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206599 138bc75d-0d04-0410-961f-82ee72b054a4