tree-optimization/127105 - ICE with empty reduction

When we try to analyze a reduction chain we ICE when we access
the single stmt we want to use after verifying that single stmt
exists, but we do the access before.  Oops.

	PR tree-optimization/127105
	* tree-vect-slp.cc (vect_analyze_slp_reduc_chain): Access
	scalar_stmts[0] only after we determined it exists.

	* gcc.dg/vect/vect-pr127105.c: New testcase.

(cherry picked from commit 5fa2866f2674d274034de150f669aee611c2d9fe)
2 files changed