]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/65409 (ICE in store_field)
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 16 Mar 2015 10:30:29 +0000 (10:30 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 16 Mar 2015 10:30:29 +0000 (10:30 +0000)
PR middle-end/65409
* expr.c (store_field): Do not do a direct block copy if the source is
a PARALLEL with BLKmode.

From-SVN: r221456

gcc/ChangeLog
gcc/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr65049.C [new file with mode: 0644]

index f5e971f8262037f0c842d7bc00ff14f2babbb241..64cf4c2787c7e59d90bef5dcd8a82ff37c7334a8 100644 (file)
@@ -1,3 +1,9 @@
+2015-03-16  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR middle-end/65409
+       * expr.c (store_field): Do not do a direct block copy if the source is
+       a PARALLEL with BLKmode.
+
 2015-03-12  Dominik Vogt  <vogt@linux.vnet.ibm.com>
 
        * config/s390/s390.c (s390_reorg): Move code to output nops after label
index 8ec37336989cdcf97672ab308edb803847768868..777a191773e0c87ec1c8ad6fda1bdf45e45daca8 100644 (file)
@@ -6430,11 +6430,12 @@ store_field (rtx target, HOST_WIDE_INT bitsize, HOST_WIDE_INT bitpos,
          && mode != TYPE_MODE (TREE_TYPE (exp)))
        temp = convert_modes (mode, TYPE_MODE (TREE_TYPE (exp)), temp, 1);
 
-      /* If the modes of TEMP and TARGET are both BLKmode, both
-        must be in memory and BITPOS must be aligned on a byte
-        boundary.  If so, we simply do a block copy.  Likewise
-        for a BLKmode-like TARGET.  */
-      if (GET_MODE (temp) == BLKmode
+      /* If TEMP is not a PARALLEL (see below) and its mode and that of TARGET
+        are both BLKmode, both must be in memory and BITPOS must be aligned
+        on a byte boundary.  If so, we simply do a block copy.  Likewise for
+        a BLKmode-like TARGET.  */
+      if (GET_CODE (temp) != PARALLEL
+         && GET_MODE (temp) == BLKmode
          && (GET_MODE (target) == BLKmode
              || (MEM_P (target)
                  && GET_MODE_CLASS (GET_MODE (target)) == MODE_INT
index 6465a02f381e485d8641687a10438c7b0483bbd1..adf9881d79cbb171e2777c10b886738a4f8a9a97 100644 (file)
@@ -1,3 +1,7 @@
+2015-03-16  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * testsuite/g++.dg/pr65049.C: New test.
+
 2015-03-16  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/loop_optimization18.ad[sb]: New test.
diff --git a/gcc/testsuite/g++.dg/pr65049.C b/gcc/testsuite/g++.dg/pr65049.C
new file mode 100644 (file)
index 0000000..7ced500
--- /dev/null
@@ -0,0 +1,19 @@
+// PR middle-end/65409
+// Reported by Ignacy Gawedzki <bugs@qult.net>
+
+struct Foo
+{
+  Foo() {}
+  int  a;
+  int  b;
+  char c;
+};
+
+Foo copy_foo(Foo);
+
+struct Bar : Foo
+{
+  Bar(Foo t) : Foo(copy_foo(t)) {}
+};
+
+Bar a = Foo();