aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2015-11-08 18:33:42 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-11-08 18:33:42 +0000
commitee45a32dae253f7daa966573eb8cb64b2cf7bf52 (patch)
treecf927ff52a6d5ba28290472db09363fe67a835d6 /gcc/tree-dfa.c
parenteb11eb157cf07500e2915da8a72f2f3a501cc5ae (diff)
downloadgcc-ee45a32dae253f7daa966573eb8cb64b2cf7bf52.zip
gcc-ee45a32dae253f7daa966573eb8cb64b2cf7bf52.tar.gz
gcc-ee45a32dae253f7daa966573eb8cb64b2cf7bf52.tar.bz2
Merge of the scalar-storage-order branch.
From-SVN: r229965
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r--gcc/tree-dfa.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 952d136..bb5cd49 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -368,12 +368,14 @@ get_or_create_ssa_default_def (struct function *fn, tree var)
base variable. The access range is delimited by bit positions *POFFSET and
*POFFSET + *PMAX_SIZE. The access size is *PSIZE bits. If either
*PSIZE or *PMAX_SIZE is -1, they could not be determined. If *PSIZE
- and *PMAX_SIZE are equal, the access is non-variable. */
+ and *PMAX_SIZE are equal, the access is non-variable. If *PREVERSE is
+ true, the storage order of the reference is reversed. */
tree
get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
HOST_WIDE_INT *psize,
- HOST_WIDE_INT *pmax_size)
+ HOST_WIDE_INT *pmax_size,
+ bool *preverse)
{
offset_int bitsize = -1;
offset_int maxsize;
@@ -381,7 +383,8 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
offset_int bit_offset = 0;
bool seen_variable_array_ref = false;
- /* First get the final access size from just the outermost expression. */
+ /* First get the final access size and the storage order from just the
+ outermost expression. */
if (TREE_CODE (exp) == COMPONENT_REF)
size_tree = DECL_SIZE (TREE_OPERAND (exp, 1));
else if (TREE_CODE (exp) == BIT_FIELD_REF)
@@ -398,6 +401,8 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
&& TREE_CODE (size_tree) == INTEGER_CST)
bitsize = wi::to_offset (size_tree);
+ *preverse = reverse_storage_order_for_component_p (exp);
+
/* Initially, maxsize is the same as the accessed element size.
In the following it will only grow (or become -1). */
maxsize = bitsize;