This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/71650] unnecessary call to __memcpy_chk emitted on a bounded copy
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 24 Jun 2016 19:51:53 +0000
- Subject: [Bug middle-end/71650] unnecessary call to __memcpy_chk emitted on a bounded copy
- Auto-submitted: auto-generated
- References: <bug-71650-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71650
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The question is if we want to do anything here. The problem is that VRP ranges
are computed from many sources, it can be comparisons in the code you show, or
masking of values, but it can as well be just because we prove that using
values outside of the ranges would necessarily trigger undefined behavior.
But, -D_FORTIFY_SOURCE=2 is a security feature to protect against undefined
behavior, and we don't have information whether the particular VR is guaranteed
in all executions or only those that don't invoke UB.