]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/42774 (ICE in get_aligned_mem, at config/alpha/alpha.c:1484)
authorUros Bizjak <uros@gcc.gnu.org>
Mon, 18 Jan 2010 21:44:32 +0000 (22:44 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Mon, 18 Jan 2010 21:44:32 +0000 (22:44 +0100)
PR target/42774
* config/alpha/predicates.md (aligned_memory_operand): Return 0 for
memory references with unaligned offsets.  Remove CQImode handling.
(unaligned_memory_operand): Return 1 for memory references with
unaligned offsets.  Remove CQImode handling.

testsuite/ChangeLog:

PR target/42774
* gcc.target/alpha/pr42774.c: New test.

From-SVN: r156024

gcc/ChangeLog
gcc/config/alpha/predicates.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/alpha/pr42774.c [new file with mode: 0644]

index fe325ce7dc54bc02f944fa18547bf9b7b8508676..cecb2e42fcbef9968a3e3b730ac12f88c64b852d 100644 (file)
@@ -1,3 +1,11 @@
+2010-01-18  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/42774
+       * config/alpha/predicates.md (aligned_memory_operand): Return 0 for
+       memory references with unaligned offsets.  Remove CQImode handling.
+       (unaligned_memory_operand): Return 1 for memory references with
+       unaligned offsets.  Remove CQImode handling.
+
 2010-01-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        Backport from mainline:
@@ -11,7 +19,7 @@
 2010-01-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        Backport from mainline
-       2010-01-05  Paolo Bonzini  <bonzinI@gnu.rg>
+       2010-01-05  Paolo Bonzini  <bonzini@gnu.org>
                    H.J. Lu  <hongjiu.lu@intel.com>
 
        PR target/42542
index f7c231822a102c4049ba99c20ec1a64f9e7787d9..476a89d0769cb39cad53bc4b080f1a6dbbd3ed34 100644 (file)
        (match_code "mem"))
 {
   rtx base;
+  int offset;
 
   if (MEM_ALIGN (op) >= 32)
     return 1;
 
-  if (mode == CQImode)
-    return 0;
-
   op = XEXP (op, 0);
 
   /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo)
   if (reload_in_progress
       && GET_CODE (op) == PLUS
       && GET_CODE (XEXP (op, 0)) == PLUS)
-    base = XEXP (XEXP (op, 0), 0);
+    {
+      base = XEXP (XEXP (op, 0), 0);
+      offset = INTVAL (XEXP (op, 1));
+    }
   else
     {
       if (! memory_address_p (mode, op))
        return 0;
-      base = (GET_CODE (op) == PLUS ? XEXP (op, 0) : op);
+      if (GET_CODE (op) == PLUS)
+       {
+         base = XEXP (op, 0);
+         offset = INTVAL (XEXP (op, 1));
+       }
+      else
+       {
+         base = op;
+         offset = 0;
+       }
     }
 
+  if (offset % GET_MODE_SIZE (mode))
+    return 0;
+
   return (GET_CODE (base) == REG && REGNO_POINTER_ALIGN (REGNO (base)) >= 32);
 })
 
        (match_code "mem"))
 {
   rtx base;
+  int offset;
 
   if (MEM_ALIGN (op) >= 32)
     return 0;
 
-  if (mode == CQImode)
-    return 1;
-
   op = XEXP (op, 0);
 
   /* LEGITIMIZE_RELOAD_ADDRESS creates (plus (plus reg const_hi) const_lo)
   if (reload_in_progress
       && GET_CODE (op) == PLUS
       && GET_CODE (XEXP (op, 0)) == PLUS)
-    base = XEXP (XEXP (op, 0), 0);
+    {
+      base = XEXP (XEXP (op, 0), 0);
+      offset = INTVAL (XEXP (op, 1));
+    }
   else
     {
       if (! memory_address_p (mode, op))
        return 0;
-      base = (GET_CODE (op) == PLUS ? XEXP (op, 0) : op);
+      if (GET_CODE (op) == PLUS)
+       {
+         base = XEXP (op, 0);
+         offset = INTVAL (XEXP (op, 1));
+       }
+      else
+       {
+         base = op;
+         offset = 0;
+       }
     }
 
+  if (offset % GET_MODE_SIZE (mode))
+    return 1;
+
   return (GET_CODE (base) == REG && REGNO_POINTER_ALIGN (REGNO (base)) < 32);
 })
 
index 8b02ec546b13f8aacf0ea00849a30bfc51756964..8d02df2df5e4811e802ce84ef198705e3eaea998 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-18  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/42774
+       * gcc.target/alpha/pr42774.c: New test.
+
 2010-01-17  H.J. Lu  <hongjiu.lu@intel.com>
 
        Backport from mainline:
diff --git a/gcc/testsuite/gcc.target/alpha/pr42774.c b/gcc/testsuite/gcc.target/alpha/pr42774.c
new file mode 100644 (file)
index 0000000..6568800
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mcpu=ev4" } */
+
+unsigned int ntfs_getinfo(void *p)
+{
+    char bootsect[8];
+
+    __builtin_memcpy(bootsect, p, sizeof bootsect);
+    return *(unsigned short *)(bootsect + 3);
+}