i386: Fix array index in expander
authorNathan Sidwell <nathan@acm.org>
Fri, 11 Sep 2020 21:13:52 +0000 (14:13 -0700)
committerNathan Sidwell <nathan@acm.org>
Fri, 11 Sep 2020 21:19:04 +0000 (14:19 -0700)
I noticed a compiler warning about out-of-bound access.  Fixed thusly.

gcc/
* config/i386/sse.md (mov<mode>): Fix operand indices.

gcc/config/i386/sse.md

index a728b979f01037174cdf61c97838e87211738ed5..a784346a23b946bd8c7727f45ede46b7d1132305 100644 (file)
        (match_operand:MASK_DWI 1 "nonimmediate_operand"))]
   "TARGET_AVX512VP2INTERSECT"
 {
-  if (MEM_P (operands[1]) && MEM_P (operands[2]))
+  if (MEM_P (operands[0]) && MEM_P (operands[1]))
     operands[1] = force_reg (<MODE>mode, operands[1]);
 })