new file mode 100644
@@ -0,0 +1,19 @@
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-O3 -march=x86-64 -mfpmath=sse" } */
+
+#include <stdint.h>
+
+#define loop_t uint32_t
+#define idx_t uint32_t
+
+void loop(double * const __restrict__ dst,
+ double const * const __restrict__ src,
+ idx_t const * const __restrict__ idx,
+ loop_t const begin,
+ loop_t const end)
+{
+ for (loop_t i = begin; i < end; ++i)
+ dst[i] = 42.0 * src[idx[i]];
+}
+
+/* { dg-final { scan-assembler-times "mulpd" 2 } } */
new file mode 100644
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=skylake -mfpmath=sse" } */
+
+#include "pr88531-1a.c"
+
+/* { dg-final { scan-assembler-times "vgatherdpd" 4 { target { ! lp64 } } } } */
+/* { dg-final { scan-assembler-times "vgatherqpd" 4 { target lp64 } } } */
+/* { dg-final { scan-assembler-times "vmulpd" 4 } } */
new file mode 100644
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=skylake-avx512 -mfpmath=sse" } */
+
+#include "pr88531-1a.c"
+
+/* { dg-final { scan-assembler-times "vgatherdpd" 4 { target { ! lp64 } } } } */
+/* { dg-final { scan-assembler-times "vgatherqpd" 4 { target lp64 } } } */
+/* { dg-final { scan-assembler-times "vmulpd" 4 } } */
new file mode 100644
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=x86-64 -mfpmath=sse" } */
+
+#include <stdint.h>
+
+#define loop_t uint32_t
+#define idx_t uint32_t
+
+void loop(float * const __restrict__ dst,
+ float const * const __restrict__ src,
+ idx_t const * const __restrict__ idx,
+ loop_t const begin,
+ loop_t const end)
+{
+ for (loop_t i = begin; i < end; ++i)
+ dst[i] = 42.0 * src[idx[i]];
+}
+
+/* { dg-final { scan-assembler-times "mulps" 1 } } */
new file mode 100644
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=skylake -mfpmath=sse" } */
+
+#include "pr88531-2a.c"
+
+/* { dg-final { scan-assembler-times "vmulps" 2 } } */
new file mode 100644
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=skylake-avx512 -mfpmath=sse" } */
+
+#include "pr88531-2a.c"
+
+/* { dg-final { scan-assembler-times "vmulps" 2 } } */