diff options
author | Martin Sebor <msebor@redhat.com> | 2020-11-16 20:01:10 -0700 |
---|---|---|
committer | Martin Sebor <msebor@redhat.com> | 2020-11-16 20:01:10 -0700 |
commit | 3072125a40ccfc139a92d44fb3911a8a7186b025 (patch) | |
tree | f8d3b5964d6e4b7f39f1ec0f197cf23179297f23 /gcc/tree-ssa-uninit.c | |
parent | b1ecb86569f63f897f6a95049c4ccf400bddeaad (diff) | |
download | gcc-3072125a40ccfc139a92d44fb3911a8a7186b025.zip gcc-3072125a40ccfc139a92d44fb3911a8a7186b025.tar.gz gcc-3072125a40ccfc139a92d44fb3911a8a7186b025.tar.bz2 |
PR middle-end/97840 - Bogus -Wmaybe-uninitialized passing an empty object to a function
gcc/ChangeLog:
* tree-ssa-uninit.c (maybe_warn_operand): Call is_empty_type.
* tree.c (default_is_empty_type): Rename...
(is_empty_type): ...to this.
* tree.h (is_empty_type): Declare.
Diffstat (limited to 'gcc/tree-ssa-uninit.c')
-rw-r--r-- | gcc/tree-ssa-uninit.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c index c94831b..516a7bd 100644 --- a/gcc/tree-ssa-uninit.c +++ b/gcc/tree-ssa-uninit.c @@ -404,10 +404,7 @@ maybe_warn_operand (ao_ref &ref, gimple *stmt, tree lhs, tree rhs, tree rhstype = TREE_TYPE (rhs); if (POINTER_TYPE_P (rhstype)) rhstype = TREE_TYPE (rhstype); - if (TYPE_EMPTY_P (rhstype) - || (RECORD_OR_UNION_TYPE_P (rhstype) - && (!first_field (rhstype) - || default_is_empty_record (rhstype)))) + if (is_empty_type (rhstype)) return NULL_TREE; bool warned = false; |