OSDN Git Service

* emit-rtl.c (get_mem_attrs): Don't default alignment for non-BLKmode
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 27 Jan 2002 18:29:33 +0000 (18:29 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 27 Jan 2002 18:29:33 +0000 (18:29 +0000)
if not STRICT_ALIGNMENT.
* rtl.h (MEM_ALIGN): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49268 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/emit-rtl.c
gcc/rtl.h

index 2b460a9..c245eea 100644 (file)
@@ -1,3 +1,9 @@
+Sun Jan 27 13:23:40 2002  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * emit-rtl.c (get_mem_attrs): Don't default alignment for non-BLKmode
+       if not STRICT_ALIGNMENT.
+       * rtl.h (MEM_ALIGN): Likewise.
+
 2002-01-27  Craig Rodrigues  <rodrigc@gcc.gnu.org>
 
        * doc/invoke.texi (-fdump-translation-unit): Revert this
index 37f0d9f..2f3e100 100644 (file)
@@ -292,7 +292,8 @@ get_mem_attrs (alias, expr, offset, size, align, mode)
       && (size == 0
          || (mode != BLKmode && GET_MODE_SIZE (mode) == INTVAL (size)))
       && (align == BITS_PER_UNIT
-         || (mode != BLKmode && align == GET_MODE_ALIGNMENT (mode))))
+         || (STRICT_ALIGNMENT
+             && mode != BLKmode && align == GET_MODE_ALIGNMENT (mode))))
     return 0;
 
   attrs.alias = alias;
index 4ef5c4c..b474531 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -926,12 +926,12 @@ do {                                              \
  : GET_MODE (RTX) != BLKmode ? GEN_INT (GET_MODE_SIZE (GET_MODE (RTX)))        \
  : 0)
 
-/* For a MEM rtx, the alignment in bits.  */
+/* For a MEM rtx, the alignment in bits.  We can use the alignment of the
+   mode as a default when STRICT_ALIGNMENT, but not if not.  */
 #define MEM_ALIGN(RTX)                                                 \
 (MEM_ATTRS (RTX) != 0 ? MEM_ATTRS (RTX)->align                         \
- : GET_MODE (RTX) != BLKmode ? GET_MODE_ALIGNMENT (GET_MODE (RTX))     \
- : BITS_PER_UNIT)
-
+ : (STRICT_ALIGNMENT && GET_MODE (RTX) != BLKmode                      \
+    ? GET_MODE_ALIGNMENT (GET_MODE (RTX)) : BITS_PER_UNIT))
 
 /* Copy the attributes that apply to memory locations from RHS to LHS.  */
 #define MEM_COPY_ATTRIBUTES(LHS, RHS)                          \