https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61320

wangzheyu <tony.wang at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tony.wang at arm dot com

--- Comment #64 from wangzheyu <tony.wang at arm dot com> ---
> 
> Fix:
> 
> Index: gcc/tree-ssa-loop-ivopts.c
> ===================================================================
> --- gcc/tree-ssa-loop-ivopts.c  (revision 213050)
> +++ gcc/tree-ssa-loop-ivopts.c  (working copy)
> @@ -1704,6 +1704,8 @@ may_be_unaligned_p (tree ref, tree step)
>      return false;
>  
>    unsigned int align = TYPE_ALIGN (TREE_TYPE (ref));
> +  if (GET_MODE_ALIGNMENT (TYPE_MODE (TREE_TYPE (ref))) > align)
> +    align = GET_MODE_ALIGNMENT (TYPE_MODE (TREE_TYPE (ref)));
>  
>    unsigned HOST_WIDE_INT bitpos;
>    unsigned int ref_align;
> 
> can you test and apply that patch?

Also run into a similar regression on arm target, which will generate unaligned
memory access on target which don't support unaligned data access. This patch
does fix this regression.

Thx

Reply via email to