diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-12-04 13:22:31 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-12-04 13:22:31 +0000 |
commit | 7b48bf2011b4020c4a5a2d5d4149b03983f72cc2 (patch) | |
tree | b07a064ee6bddbe6ddf73a98a9c131b5ab6a0f5f /gcc/tree-vect-data-refs.c | |
parent | 8cd167a5ad8baf4988e07fcbc9c9cc338c02d3d1 (diff) | |
download | gcc-tarball-7b48bf2011b4020c4a5a2d5d4149b03983f72cc2.tar.gz |
gcc-5.3.0gcc-5.3.0
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r-- | gcc/tree-vect-data-refs.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 3913862eb6..8085d20752 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -648,7 +648,6 @@ vect_compute_data_ref_alignment (struct data_reference *dr) tree ref = DR_REF (dr); tree vectype; tree base, base_addr; - bool base_aligned; tree misalign; tree aligned_to; unsigned HOST_WIDE_INT alignment; @@ -721,6 +720,19 @@ vect_compute_data_ref_alignment (struct data_reference *dr) } } + /* To look at alignment of the base we have to preserve an inner MEM_REF + as that carries alignment information of the actual access. */ + base = ref; + while (handled_component_p (base)) + base = TREE_OPERAND (base, 0); + if (TREE_CODE (base) == MEM_REF) + base = build2 (MEM_REF, TREE_TYPE (base), base_addr, + build_int_cst (TREE_TYPE (TREE_OPERAND (base, 1)), 0)); + unsigned int base_alignment = get_object_alignment (base); + + if (base_alignment >= TYPE_ALIGN (TREE_TYPE (vectype))) + DR_VECT_AUX (dr)->base_element_aligned = true; + alignment = TYPE_ALIGN_UNIT (vectype); if ((compare_tree_int (aligned_to, alignment) < 0) @@ -736,21 +748,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr) return true; } - /* To look at alignment of the base we have to preserve an inner MEM_REF - as that carries alignment information of the actual access. */ - base = ref; - while (handled_component_p (base)) - base = TREE_OPERAND (base, 0); - if (TREE_CODE (base) == MEM_REF) - base = build2 (MEM_REF, TREE_TYPE (base), base_addr, - build_int_cst (TREE_TYPE (TREE_OPERAND (base, 1)), 0)); - - if (get_object_alignment (base) >= TYPE_ALIGN (vectype)) - base_aligned = true; - else - base_aligned = false; - - if (!base_aligned) + if (base_alignment < TYPE_ALIGN (vectype)) { /* Strip an inner MEM_REF to a bare decl if possible. */ if (TREE_CODE (base) == MEM_REF @@ -780,8 +778,9 @@ vect_compute_data_ref_alignment (struct data_reference *dr) dump_printf (MSG_NOTE, "\n"); } - ((dataref_aux *)dr->aux)->base_decl = base; - ((dataref_aux *)dr->aux)->base_misaligned = true; + DR_VECT_AUX (dr)->base_decl = base; + DR_VECT_AUX (dr)->base_misaligned = true; + DR_VECT_AUX (dr)->base_element_aligned = true; } /* If this is a backward running DR then first access in the larger |