aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-12-08 09:05:38 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-12-08 09:05:38 +0000
commit908b951938511131cf3858c75924db323de415ea (patch)
treef9866f9a7ab239814de604e3414349d48cdece0b /gcc/expr.c
parentc37257a1f686bdd260a2edc445f8b3f24dceec2e (diff)
downloadgcc-908b951938511131cf3858c75924db323de415ea.zip
gcc-908b951938511131cf3858c75924db323de415ea.tar.gz
gcc-908b951938511131cf3858c75924db323de415ea.tar.bz2
re PR tree-optimization/51315 (unaligned memory accesses generated with -ftree-sra)
PR tree-optimization/51315 * tree.h (get_object_or_type_alignment): Declare. * expr.c (get_object_or_type_alignment): Move to... * builtins.c (get_object_or_type_alignment): ...here. Add assertion. * tree-sra.c (tree_non_mode_aligned_mem_p): Rename to... (tree_non_aligned_mem_p): ...this. Add ALIGN parameter. Look into MEM_REFs and use get_object_or_type_alignment for them. (build_accesses_from_assign): Adjust for above change. (access_precludes_ipa_sra_p): Likewise. From-SVN: r182102
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 524ddab..b2166bd 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4544,27 +4544,6 @@ get_bit_range (unsigned HOST_WIDE_INT *bitstart,
}
}
-/* Return the alignment of the object EXP, also considering its type
- when we do not know of explicit misalignment.
- ??? Note that, in the general case, the type of an expression is not kept
- consistent with misalignment information by the front-end, for
- example when taking the address of a member of a packed structure.
- However, in most of the cases, expressions have the alignment of
- their type, so we optimistically fall back to the alignment of the
- type when we cannot compute a misalignment. */
-
-static unsigned int
-get_object_or_type_alignment (tree exp)
-{
- unsigned HOST_WIDE_INT misalign;
- unsigned int align = get_object_alignment_1 (exp, &misalign);
- if (misalign != 0)
- align = (misalign & -misalign);
- else
- align = MAX (TYPE_ALIGN (TREE_TYPE (exp)), align);
- return align;
-}
-
/* Expand an assignment that stores the value of FROM into TO. If NONTEMPORAL
is true, try generating a nontemporal store. */