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

--- Comment #4 from Andrew Macleod <amacleod at redhat dot com> ---
Created attachment 54270
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54270&action=edit
possible patch

When the on-entry cache is updated for a block, all incoming ranges are unioned
together and the result saved.  Some of those blocks may turn out to be
unexecutable, with that information already reflected in the cache.  When
updating, intersect the new value with the original to avoid losing this
information.

This patch fixes the problem so the cache never loses information once it has
it.  However, its causing a regression in c-c++-common/Warray-bounds-3.c in the
wrestrict pass for some reason:

 T (char, 9, a, a + SAR ( 0,  6), 3);   /* { dg-warning "forming offset 9 is
out of the bounds \\\[0, 9] of object " "memcpy" } */

is now issuing the message with an offset of -1 instead of 9, even though every
range I can find is still the same,   I spent some time looking at it, but have
a hard time figuring out what wrestrict is actually doing. 

I'll keep looking at it next week to see if I can figure out what is going on..

Reply via email to