vect: gate COMPLEX_MUL on FP_CONTRACT_FAST [PR125431]

The checks for FP_CONTRACT_FAST were in the wrong place for complex_mul.

The location it was in would only block FMA but not MUL.  It would also not
really reject the forming of the FMA, it would just create an invalid collection
of nodes which would fail analysis later on.

However complex multiplication is also a contraction, since it's doing

real = a*c - b*d
imag = a*d + b*c

This moves the checks up to earliest possible location and actually just returns
and adds the missing check for FMS.

gcc/ChangeLog:

	PR tree-optimization/125431
	* tree-vect-slp-patterns.cc (complex_mul_pattern::matches,
	complex_fms_pattern::matches): Gate on FP contraction.

gcc/testsuite/ChangeLog:

	PR tree-optimization/125431
	* gfortran.dg/vect/pr125431.f90: New test.

(cherry picked from commit 074ed30c2382f163b74e98baa4c242a721c57519)
2 files changed