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

--- Comment #33 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:5f9cd512c4278621435cce486dd00248ea2e821c

commit r10-6885-g5f9cd512c4278621435cce486dd00248ea2e821c
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Thu Feb 27 10:12:52 2020 +0100

    sccvn: Handle non-byte aligned offset or size for memset (, 123, )
[PR93945]

    The following is the last spot in vn_reference_lookup_3 that didn't allow
    non-byte aligned offsets or sizes.  To be precise, it did allow size that
    wasn't multiple of byte size and that caused a wrong-code issue on
    big-endian, as the pr93945.c testcase shows, so for GCC 9 we should add
    && multiple_p (ref->size, BITS_PER_UNIT) check instead.
    For the memset with SSA_NAME middle-argument, it still requires
byte-aligned
    offset, as we'd otherwise need to rotate the value at runtime.

    2020-02-27  Jakub Jelinek  <ja...@redhat.com>

        PR tree-optimization/93582
        PR tree-optimization/93945
        * tree-ssa-sccvn.c (vn_reference_lookup_3): Handle memset with
        non-zero INTEGER_CST second argument and ref->offset or ref->size
        not a multiple of BITS_PER_UNIT.

        * gcc.dg/tree-ssa/pr93582-9.c: New test.
        * gcc.c-torture/execute/pr93945.c: New test.

Reply via email to