diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2022-10-14 00:55:40 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2022-10-14 00:59:31 +0200 |
commit | c26d335fffc689051ee5826455c9d54d1fcf1816 (patch) | |
tree | e535bd578278e70ec247442af67c9aa835359ede /gcc/cp | |
parent | 537e08cfad04e79fb97d368e397cfc7e782865ec (diff) | |
download | gcc-c26d335fffc689051ee5826455c9d54d1fcf1816.zip gcc-c26d335fffc689051ee5826455c9d54d1fcf1816.tar.gz gcc-c26d335fffc689051ee5826455c9d54d1fcf1816.tar.bz2 |
Fix bogus -Wstringop-overflow warning
If you compile the testcase with -O2 -fno-inline -Wall, you get:
In function 'process_array3':
cc1: warning: 'process_array4' accessing 4 bytes in a region of size 3 [-
Wstringop-overflow=]
cc1: note: referencing argument 1 of type 'char[4]'
t.c:6:6: note: in a call to function 'process_array4'
6 | void process_array4 (char a[4], int n)
| ^~~~~~~~~~~~~~
cc1: warning: 'process_array4' accessing 4 bytes in a region of size 3 [-
Wstringop-overflow=]
cc1: note: referencing argument 1 of type 'char[4]'
t.c:6:6: note: in a call to function 'process_array4'
That's because the ICF IPA pass has identified the two functions and turned
process_array3 into a wrapper of process_array4.
gcc/
* gimple-ssa-warn-access.cc (pass_waccess::check_call): Return
early for calls made from thunks.
gcc/testsuite/
* gcc.dg/Wstringop-overflow-89.c: New test.
Diffstat (limited to 'gcc/cp')
0 files changed, 0 insertions, 0 deletions