diff options
Diffstat (limited to 'gcc/tree-vect-data-refs.cc')
-rw-r--r-- | gcc/tree-vect-data-refs.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc index 3ba271b..aaeb522 100644 --- a/gcc/tree-vect-data-refs.cc +++ b/gcc/tree-vect-data-refs.cc @@ -5035,7 +5035,21 @@ vect_analyze_data_refs (vec_info *vinfo, poly_uint64 *min_vf, bool *fatal) /* Set vectype for STMT. */ scalar_type = TREE_TYPE (DR_REF (dr)); tree vectype = get_vectype_for_scalar_type (vinfo, scalar_type); - if (!vectype) + + /* FIXME: If the object is in an address-space in which the pointer size + is different to the default address space then vectorizing here will + lead to an ICE down the road because the address space information + gets lost. This work-around fixes the problem until we have a proper + solution. */ + tree base_object = DR_REF (dr); + tree op = (TREE_CODE (base_object) == COMPONENT_REF + || TREE_CODE (base_object) == ARRAY_REF + ? TREE_OPERAND (base_object, 0) : base_object); + addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (op)); + bool addr_space_bug = (!ADDR_SPACE_GENERIC_P (as) + && targetm.addr_space.pointer_mode (as) != Pmode); + + if (!vectype || addr_space_bug) { if (dump_enabled_p ()) { @@ -7151,7 +7165,8 @@ vect_can_force_dr_alignment_p (const_tree decl, poly_uint64 alignment) return false; if (decl_in_symtab_p (decl) - && !symtab_node::get (decl)->can_increase_alignment_p ()) + && (!symtab_node::get (decl) + || !symtab_node::get (decl)->can_increase_alignment_p ())) return false; if (TREE_STATIC (decl)) |