+2018-06-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/85945
+ * lower-subreg.c (find_decomposable_subregs): Don't decompose float
+ subregs of multi-word pseudos unless the float mode has word size.
+
2018-06-14 Richard Biener <rguenther@suse.de>
PR middle-end/86139
were the same number and size of pieces. Hopefully this
doesn't happen much. */
- if (outer_words == 1 && inner_words > 1)
+ if (outer_words == 1
+ && inner_words > 1
+ /* Don't allow to decompose floating point subregs of
+ multi-word pseudos if the floating point mode does
+ not have word size, because otherwise we'd generate
+ a subreg with that floating mode from a different
+ sized integral pseudo which is not allowed by
+ validate_subreg. */
+ && (!FLOAT_MODE_P (GET_MODE (x))
+ || outer_size == UNITS_PER_WORD))
{
bitmap_set_bit (decomposable_context, regno);
iter.skip_subrtxes ();
--- /dev/null
+/* PR target/85945 */
+
+typedef float V __attribute__((vector_size(16)));
+union U { V v; float f[4]; };
+int f;
+float g[4];
+
+void
+foo (void)
+{
+ V d;
+ union U i;
+ i.v = d;
+ for (f = 0; f < 4; f++)
+ g[f] = i.f[f];
+}