@@ -922,9 +922,13 @@ validate_subreg (machine_mode omode, machine_mode imode,
poly_uint64 regsize = REGMODE_NATURAL_SIZE (imode);
- /* Paradoxical subregs must have offset zero. */
+ /* Paradoxical subregs must have offset zero and omode not
+ SCALAR_FLOAT_MODE_P.
+ i.e. things like (subreg:DF (reg:SF)) or (subreg:DF (reg:SI))
+ are not allowed. */
if (maybe_gt (osize, isize))
- return known_eq (offset, 0U);
+ return known_eq (offset, 0U)
+ && (!SCALAR_FLOAT_MODE_P (omode) || lra_in_progress);
/* This is a normal subreg. Verify that the offset is representable. */
new file mode 100644
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-Og" } */
+
+#define MODFL __builtin_modfl
+void
+foo (void)
+{
+ int x;
+ *((double *) &x) = 0;
+}
+
+void
+foo1 (void)
+{
+ float x;
+
+ *((double *) &x) = 0;
+}
+
+void foo2() {
+ long iptrll;
+ MODFL(0.5l, (long double *)&iptrll);
+}