[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948
law at redhat dot com
gcc-bugzilla@gcc.gnu.org
Tue Apr 21 19:14:38 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675
--- Comment #12 from Jeffrey A. Law <law at redhat dot com> ---
SO it's not terrible to get the key block cleaned up. but that's not
sufficient to resolve this issue. We all missed an important tidbit.
VRP is complaining about this:
ps.D.2041.s = &MEM <byte> [(void *)&c + 7B];
Note the object we reference in the &MEM expression, "c". "c" is a byte:
typedef unsigned char byte;
byte c;
One could argue the problem is FRE. Prior to fre3 we had:
;; basic block 9, loop depth 0
;; pred: 7
_34 = ps.D.2041.s;
_35 = _34 + 7;
ps.D.2041.s = _35;
fre3 turns that into:
ps.D.2041.s = &MEM <byte> [(void *)&c + 7B];
And we're going to lose.
One could also argue that the warning has to be tolerant of these actions from
FRE. The question would be how to do that without totally compromising the
warning.
More information about the Gcc-bugs
mailing list