(-a)*b should not be compiled to vnmul a,b with -frounding-math. Added a new -(a*b) pattern for vnmul and the old one is only used if !flag_rounding_math. Updated the costs too. This is the ARM version of https://gcc.gnu.org/ml/gcc-patches/2015-07/msg00300.html Tested with arm-none-linux-gnueabihf cross compiler. is this OK? gcc/Changelog: 2015-07-20 Szabolcs Nagy PR target/66731 * config/arm/arm.md (muldf3negdf_vfp): Handle -frounding-math. (mulsf3negsf_vfp): Likewise. * config/arm/arm.c (arm_new_rtx_costs): Fix NEG cost for VNMUL, fix MULT cost with -frounding-math. gcc/testsuite/Changelog: 2015-07-20 Szabolcs Nagy PR target/66731 * gcc.target/arm/vnmul-1.c: New. * gcc.target/arm/vnmul-2.c: New. * gcc.target/arm/vnmul-3.c: New. * gcc.target/arm/vnmul-4.c: New.