On Fri, Dec 10, 2021 at 2:30 AM Roger Sayle <ro...@nextmovesoftware.com> wrote: > > > 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.
zero sized accesses (load and stores) should have been removed during gimplification. Why was it not? Thanks, Andrew > > 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 [but I'm happy to change this]. > > This patch has been tested on x86_64-pc-linux-gnu with a make bootstrap > and make -k check with no new failures. Ok for mainline? > > > 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. > > Thanks in advance, > Roger > -- >