summaryrefslogtreecommitdiff
path: root/gcc/config/sparc/sparc.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1993-04-25 21:30:06 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1993-04-25 21:30:06 +0000
commit202bdd5e5f88ff84ac8092673d42286df9b61300 (patch)
treebcf5cba423e6b55a94bd1d6f0bdad5f4b84157c4 /gcc/config/sparc/sparc.c
parent6d1d7f0a69e96a1b7a65adf909028d61a6f751db (diff)
downloadgcc-202bdd5e5f88ff84ac8092673d42286df9b61300.tar.gz
(mem_aligned_8): Delete ifdefed out code. Add support
for TARGET_UNALIGNED_DOUBLES. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@4224 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sparc/sparc.c')
-rw-r--r--gcc/config/sparc/sparc.c54
1 files changed, 10 insertions, 44 deletions
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index f75d69a3e32..7574426d631 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -999,9 +999,11 @@ mem_aligned_8 (mem)
addr = XEXP (mem, 0);
-#if 1
/* Now that all misaligned double parms are copied on function entry,
- we can assume any 64-bit object is 64-bit aligned. */
+ we can assume any 64-bit object is 64-bit aligned except those which
+ are at unaligned offsets from the stack or frame pointer. If the
+ TARGET_UNALIGNED_DOUBLES switch is given, we do not make this
+ assumption. */
/* See what register we use in the address. */
base = 0;
@@ -1029,50 +1031,14 @@ mem_aligned_8 (mem)
if ((INTVAL (offset) & 0x7) == 0)
return 1;
}
- else
- /* Anything else, we know is properly aligned. */
- return 1;
-#else
- /* If the operand is known to have been allocated in static storage, then
- it must be aligned. */
-
- if (CONSTANT_P (addr) || GET_CODE (addr) == LO_SUM)
+ /* Anything else we know is properly aligned unless TARGET_UNALIGNED_DOUBLES
+ is true, in which case we can only assume that an access is aligned if
+ it is to an aggregate, it is to a constant address, or the address
+ involves a LO_SUM. */
+ else if (! TARGET_UNALIGNED_DOUBLES || MEM_IN_STRUCT_P (mem)
+ || CONSTANT_P (addr) || GET_CODE (addr) == LO_SUM)
return 1;
- base = 0;
- if (GET_CODE (addr) == PLUS)
- {
- if (GET_CODE (XEXP (addr, 0)) == REG
- && GET_CODE (XEXP (addr, 1)) == CONST_INT)
- {
- base = XEXP (addr, 0);
- offset = XEXP (addr, 1);
- }
- }
- else if (GET_CODE (addr) == REG)
- {
- base = addr;
- offset = const0_rtx;
- }
-
- /* Trust round enough offsets from the stack or frame pointer.
- If TARGET_HOPE_ALIGN, trust round enough offset from any register.
- If it is obviously unaligned, don't ever return true. */
- if (base
- && (REGNO (base) == FRAME_POINTER_REGNUM
- || REGNO (base) == STACK_POINTER_REGNUM
- || TARGET_HOPE_ALIGN))
- {
- if ((INTVAL (offset) & 0x7) == 0)
- return 1;
- }
- /* Otherwise, we can assume that an access is aligned if it is to an
- aggregate. Also, if TARGET_HOPE_ALIGN, then assume everything that isn't
- obviously unaligned is aligned. */
- else if (MEM_IN_STRUCT_P (mem) || TARGET_HOPE_ALIGN)
- return 1;
-#endif
-
/* An obviously unaligned address. */
return 0;
}