[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-30 Thread chantry.xavier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 --- Comment #18 from Xavier --- The lib has been recently opensourced so I can share it : https://github.com/Intersec/lib-common/blob/master/src/core/str-stream.h We have 100-200 usages of p_end/s_end/b_end so even if it's possible to patch

[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-24 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 --- Comment #17 from Martin Sebor --- As you observed, the warning disappears if the assert is removed, so that's one workaround. But rather than working around it I would suggest to rewrite the code to avoid the pointer subtraction. Chances

[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-24 Thread chantry.xavier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 --- Comment #16 from Xavier --- (In reply to Martin Sebor from comment #14) > That said and codegen improvements aside, I think the submitted test case is > sufficiently tricky that I don't see issuing a warning for it as a problem. > All

[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-22 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 --- Comment #15 from rguenther at suse dot de --- On Tue, 21 Apr 2020, law at redhat dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 > > --- Comment #12 from Jeffrey A. Law --- > SO it's not terrible to get the key block

[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 --- Comment #14 from Martin Sebor --- I can think of only one way the warning code could avoid triggering here: by assuming that the difference between two pointers into the same array is less than or equal the size of the array (with non-array

[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-21 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 Jeffrey A. Law changed: What|Removed |Added CC||drahflow at gmx dot de --- Comment #13

[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-21 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 Jeffrey A. Law changed: What|Removed |Added Priority|P3 |P2

[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-21 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 --- Comment #12 from Jeffrey A. Law --- 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 = [(void *) +

[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 --- Comment #11 from Martin Sebor --- (In reply to Richard Biener from comment #3) > (In reply to Martin Sebor from comment #1) > > The false positive is not due a shortcoming of the warning but rather due to > > GCC not having a sufficiently

[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-21 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 --- Comment #10 from rguenther at suse dot de --- On Tue, 21 Apr 2020, law at redhat dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 > > --- Comment #9 from Jeffrey A. Law --- > Yea, unrolling and the array-bounds warning

[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-21 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 --- Comment #9 from Jeffrey A. Law --- Yea, unrolling and the array-bounds warning do have bad interactions. I suspect if we cleaned up this block that the backwards threader would likely kick in: # iftmp.2_18 = PHI <1(3), 1(4), 0(5)> _19

[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-21 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 --- Comment #8 from rguenther at suse dot de --- On Tue, 21 Apr 2020, law at redhat dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 > > Jeffrey A. Law changed: > >What|Removed |Added >

[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-21 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 Jeffrey A. Law changed: What|Removed |Added CC||law at redhat dot com --- Comment #7

[Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 since r9-1948

2020-04-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94675 Jakub Jelinek changed: What|Removed |Added Summary|[9/10 regression] |[9/10 regression]