re PR target/60693 (ICE on funny memcpy)
authorJakub Jelinek <jakub@redhat.com>
Fri, 28 Mar 2014 19:31:17 +0000 (20:31 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 28 Mar 2014 19:31:17 +0000 (20:31 +0100)
PR target/60693
* config/i386/i386.c (ix86_copy_addr_to_reg): Call copy_addr_to_reg
also if addr has VOIDmode.

* gcc.target/i386/pr60693.c: New test.

From-SVN: r208915

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr60693.c [new file with mode: 0644]

index 8434f0448ecbaf4c7adee2eb7e4f75c049dabd2e..5e1879d876a11e9bf2d8be6ac3b7365dbfa56dd2 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-28  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/60693
+       * config/i386/i386.c (ix86_copy_addr_to_reg): Call copy_addr_to_reg
+       also if addr has VOIDmode.
+
 2014-03-28  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * config/arm/aarch-common.c (aarch_crypto_can_dual_issue): New.
index 842be686da975c7427f84d5f79c5ed3cd9dc7a37..328fe409bacc11aff9ed9124cc901fbd1e5a45f0 100644 (file)
@@ -22755,7 +22755,7 @@ counter_mode (rtx count_exp)
 static rtx
 ix86_copy_addr_to_reg (rtx addr)
 {
-  if (GET_MODE (addr) == Pmode)
+  if (GET_MODE (addr) == Pmode || GET_MODE (addr) == VOIDmode)
     return copy_addr_to_reg (addr);
   else
     {
index f43bd841292a37958731bf0a41541ab1fd0d6ce2..f650e3dabf8f33538aa74951d91cb04d1d387bb7 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-28  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/60693
+       * gcc.target/i386/pr60693.c: New test.
+
 2014-03-28  Vishnu K S  <Vishnu.k_s@atmel.com>
 
        * gcc.dg/pr59940.c (si): Use 32-bit SI mode instead of int.
diff --git a/gcc/testsuite/gcc.target/i386/pr60693.c b/gcc/testsuite/gcc.target/i386/pr60693.c
new file mode 100644 (file)
index 0000000..e6033a7
--- /dev/null
@@ -0,0 +1,13 @@
+/* PR target/60693 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+void bar (char *);
+
+void
+foo (void)
+{
+  char buf[4096];
+  __builtin_memcpy (buf, (void *) 0x8000, 4096);
+  bar (buf);
+}