[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-22 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 --- Comment #12 from Jeffrey A. Law --- With the v.size() > 0 guard enabled and my VRP tweaks I get no warnings. Plan is to either polish up the VRP tweaks or turn them into a match.pd pattern. Not sure which is going to be better yet.

[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-22 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 --- Comment #11 from Martin Sebor --- I agree that calling v.resize(v.size() - 0) when v.size() is zero is a bug in the program and diagnosing it should be a good thing (I think that corresponds to the test case I pasted in comment #2 and what I

[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-22 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 --- Comment #10 from Jeffrey A. Law --- So with a prototype patch to simplify the overflow checks to zero/not zero, we still get the one warning. The more I look at the code, the more I think the warning is justified. Ponder the case where

[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-22 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 --- Comment #9 from Jeffrey A. Law --- Sigh. I was looking at the wrong dump. We don't need to deal with ADD_OVERFLOW. Looking at the real test for this BZ, the guarding block has the right form: [100.00%]: _7 = MEM[(unsigned int * *)]; _8 =

[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-22 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 --- Comment #8 from Martin Sebor --- (In reply to Jeffrey A. Law from comment #4) > So the simplified tests are interesting, but ultimately too simplified. You're right, the test case in comment #2 is oversimplified. The one in the thread on

[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-22 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 --- Comment #7 from Marc Glisse --- (In reply to Jakub Jelinek from comment #6) > VRP already handles that, Nice :-) Thanks and sorry for not checking myself. > IFN_*_OVERFLOW can appear already during gimplification if >

[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 --- Comment #6 from Jakub Jelinek --- (In reply to Marc Glisse from comment #5) > I thought ADD_OVERFLOW would appear in the widening_mul pass, i.e. after all > the VRP passes are done? On the other hand, teaching VRP about *_OVERFLOW > sounds

[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-22 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 --- Comment #5 from Marc Glisse --- (In reply to Jeffrey A. Law from comment #4) > So the simplified tests are interesting, but ultimately too simplified. The > VRP prototype which works on the simplified testcases doesn't work on the > real

[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-22 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 --- Comment #4 from Jeffrey A. Law --- So the simplified tests are interesting, but ultimately too simplified. The VRP prototype which works on the simplified testcases doesn't work on the real testcase for this BZ. The key sequences look

[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-18 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 Jeffrey A. Law changed: What|Removed |Added Priority|P3 |P2 CC|

[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-16 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 Martin Sebor changed: What|Removed |Added Keywords||patch --- Comment #3 from Martin Sebor

[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-16 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 Martin Sebor changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed|

[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-16 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org,

[Bug c++/79095] [7 regression] spurious stringop-overflow warning

2017-01-15 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79095 Richard Biener changed: What|Removed |Added Keywords||diagnostic Target Milestone|---