This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/83239] False positive from -Wstringop-overflow on simple std::vector code
- From: "law at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 05 Dec 2017 16:55:12 +0000
- Subject: [Bug middle-end/83239] False positive from -Wstringop-overflow on simple std::vector code
- Auto-submitted: auto-generated
- References: <bug-83239-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83239
Jeffrey A. Law <law at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |redi at gcc dot gnu.org
--- Comment #8 from Jeffrey A. Law <law at redhat dot com> ---
Jon's call on the annotation, obviously.
In theory that kind of annotation should be zero cost as there is no code on
the __builtin_unreachable path which in turn allows the various optimizers to
remove the __builtin_unreachable as well as the controlling condition.
I know from recent work a __builtin_unreachable like this can sneak through the
gimple optimizers. But it was a pretty oddball case involving computed jumps
where the computed jump target was an empty __builtin_unreachable block.
Similarly I just fixed a bug where the ranges implied by the
__builtin_unreachables were getting lost.
My point for Jon is that while these are supposed to be zero cost ways to
describe situations that aren't supposed to happen, a little verification seems
wise :-)