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

--- Comment #7 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> 
---
Author: rsandifo
Date: Tue Feb 20 14:44:24 2018
New Revision: 257847

URL: https://gcc.gnu.org/viewcvs?rev=257847&root=gcc&view=rev
Log:
Fix incorrect TARGET_MEM_REF alignment (PR 84419)

expand_call_mem_ref checks for TARGET_MEM_REFs that have compatible
type, but it didn't then go on to install the specific type we need,
which might have different alignment due to:

  if (TYPE_ALIGN (type) != align)
    type = build_aligned_type (type, align);

This was causing masked stores to be incorrectly marked as
aligned on AVX512.

2018-02-20  Richard Sandiford  <richard.sandif...@linaro.org>

gcc/
        PR tree-optimization/84419
        * internal-fn.c (expand_call_mem_ref): Create a TARGET_MEM_REF
        with the required type if its current type is compatible but
        different.

gcc/testsuite/
        PR tree-optimization/84419
        * gcc.dg/vect/pr84419.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr84419.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/internal-fn.c
    trunk/gcc/testsuite/ChangeLog

Reply via email to