[Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 12 17:44:08 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103989
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That IMHO bogus D.35417 = D.35181; statement comes from the inliner and it can
be fixed easily:
--- gcc/tree-inline.c.jj 2022-01-11 23:11:23.422275652 +0100
+++ gcc/tree-inline.c 2022-01-12 18:37:44.119950128 +0100
@@ -3608,7 +3608,7 @@ setup_one_parameter (copy_body_data *id,
init_stmt = gimple_build_assign (def, rhs);
}
}
- else
+ else if (!is_empty_type (TREE_TYPE (var)))
init_stmt = gimple_build_assign (var, rhs);
if (bb && init_stmt)
which I think matches what the gimplifier does with assignments of empty type
objects.
Unfortunately that patch doesn't do anything with these warnings.
More information about the Gcc-bugs
mailing list