This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

--- Comment #11 from Martin Sebor <msebor at gcc dot gnu.org> ---
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 based my patch with the trap
on.)

If your patch avoids the warning when the if guard in the test case in comment
#0 is uncommented that would seem like a fix.

As a separate change (in GCC 8) I do think it would be worth considering the
idea of inserting the trap, and also having tree-loop-distribution.c issue a
better warning when it detects an out of bounds loop like this one.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]