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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sa...@gcc.gnu.org>:

https://gcc.gnu.org/g:2a1c3b69c015ea49e4c7c08291efd8f7e28e1193

commit r12-5891-g2a1c3b69c015ea49e4c7c08291efd8f7e28e1193
Author: Roger Sayle <ro...@nextmovesoftware.com>
Date:   Fri Dec 10 12:02:04 2021 +0000

    PR ipa/103601: ICE compiling CSiBE in ipa-modref's insert_kill.

    This patch fixes PR ipa/103061 which is P1 regression that shows up as
    an ICE in ipa-modref-tree.c's insert_kill when compiling the CSiBE
    benchmark.  I believe the underlying cause is that the new kill tracking
    functionality wasn't anticipating memory accesses that are zero bits
    wide!?.  The failing source code (test case) contains the unusual lines:
    typedef struct { } spinlock_t;
    and
    q->lock = (spinlock_t) { };
    Making spinlock_t larger, or removing the assignment work around the issue.

    The one line patch below to useful_for_kill_p teaches IPA that a memory
    write is only useful as a "kill" if it is more than zero bits wide.
    In theory, the existing known_size_p (size) test is now redundant, as
    poly_int64 currently uses the value -1 for unknown size values,
    but the proposed change makes the semantics clear, and defends against
    possible future changes in representation.

    2021-12-10  Roger Sayle  <ro...@nextmovesoftware.com>

    gcc/ChangeLog
            PR ipa/103601
            * ipa-modref-tree.h (useful_for_kill_p): Zero width accesses aren't
            useful for kill tracking.

    gcc/testsuite/ChangeLog
            PR ipa/103601
            * gcc.dg/ipa/pr103601.c: New test case.

Reply via email to