diff options
author | David Malcolm <dmalcolm@redhat.com> | 2022-02-03 16:21:27 -0500 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2022-02-07 18:31:54 -0500 |
commit | 9d2c0fad59745bf67aa6471e8c9e96c351f0de59 (patch) | |
tree | 993b5fb8ad10b5445bcdbe248127fe75cf0aec4f /gcc/cp/constraint.cc | |
parent | f30e65e94d14a249fb810aea5bddb6afe3e706df (diff) | |
download | gcc-9d2c0fad59745bf67aa6471e8c9e96c351f0de59.zip gcc-9d2c0fad59745bf67aa6471e8c9e96c351f0de59.tar.gz gcc-9d2c0fad59745bf67aa6471e8c9e96c351f0de59.tar.bz2 |
analyzer: fixes to memcpy [PR103872]
PR analyzer/103872 reports a failure of gcc.dg/analyzer/pr103526.c on
riscv64-unknown-elf-gcc. The issue is that I wrote the test on x86_64
where a memcpy in the test is optimized to a write to a read/write pair,
whereas due to alignment differences the analyzer can see it as a
memcpy call, revealing problems with the analyzer's implementation
of memcpy.
This patch reimplements region_model::impl_call_memcpy in terms of a
get_store_value followed by a set_value, fixing the issue.
gcc/analyzer/ChangeLog:
PR analyzer/103872
* region-model-impl-calls.cc (region_model::impl_call_memcpy):
Reimplement in terms of a get_store_value followed by a set_value.
gcc/testsuite/ChangeLog:
PR analyzer/103872
* gcc.dg/analyzer/memcpy-1.c: Add alternate versions of test cases
in which the calls to memcpy are hidden from the optimizer. Add
further test cases.
* gcc.dg/analyzer/taint-size-1.c: Add test coverage for memcpy
with tainted size.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/cp/constraint.cc')
0 files changed, 0 insertions, 0 deletions