diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-07-28 11:08:29 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-07-28 11:08:29 +0200 |
commit | f9264b9008386ac3b5c795472c222fa524b127b0 (patch) | |
tree | 5e3551e1105bd6861edb3abeeec477cfb4c6e24f /libcpp/init.c | |
parent | 0ff959e0a2214fa553ac2d06ed66ede62602fc9a (diff) | |
download | gcc-f9264b9008386ac3b5c795472c222fa524b127b0.zip gcc-f9264b9008386ac3b5c795472c222fa524b127b0.tar.gz gcc-f9264b9008386ac3b5c795472c222fa524b127b0.tar.bz2 |
expander: Fix ICE in maybe_warn_rdwr_sizes [PR96335]
The following testcase ICEs in maybe_warn_rdwr_sizes. The problem is that
the caller uses its fndecl and fntype variables to fill up rdwr_map, and
the fntype in that case is a prototype with the access attribute and all
the checks needed for that performed. But the maybe_warn_rdwr_sizes
function tries to rediscover fndecl/fntype itself and does it differently
from how the caller did (for fndecl get_callee_fndecl and fntype from that
FUNCTION_DECL, otherwise sets fntype to CALL_EXPR_FN's type).
On the testcase, get_callee_fndecl does find a FUNCTION_DECL because
it does STRIP_NOPS in between.
Instead of trying to rediscover those, this patch just passes them down,
like is done in several other functions.
2020-07-28 Jakub Jelinek <jakub@redhat.com>
PR middle-end/96335
* calls.c (maybe_warn_rdwr_sizes): Add FNDECL and FNTYPE arguments,
instead of trying to rediscover them in the body.
(initialize_argument_information): Adjust caller.
* gcc.dg/pr96335.c: New test.
Diffstat (limited to 'libcpp/init.c')
0 files changed, 0 insertions, 0 deletions