Handle DECLs and EXPRESSIONs consistently (PR middle-end/97175).
authorMartin Sebor <msebor@redhat.com>
Wed, 23 Sep 2020 21:04:32 +0000 (15:04 -0600)
committerMartin Sebor <msebor@redhat.com>
Wed, 23 Sep 2020 21:10:20 +0000 (15:10 -0600)
commit6edc8f5bfe7d9db8fb8bd37bb8086a69850c6c6d
treec64709a3a48fac8d149e61be1ff8144e8ff8025d
parente977dd5edbcc3a3b88c3bd7efa1026c845af7487
Handle DECLs and EXPRESSIONs consistently (PR middle-end/97175).

gcc/ChangeLog:

PR middle-end/97175
* builtins.c (maybe_warn_for_bound): Handle both DECLs and EXPRESSIONs
in pad->dst.ref, same is pad->src.ref.

gcc/testsuite/ChangeLog:

PR middle-end/97175
* gcc.dg/Wstringop-overflow-44.c: New test.
gcc/builtins.c
gcc/testsuite/gcc.dg/Wstringop-overflow-44.c [new file with mode: 0644]