[Bug c++/80635] std::optional and bogus -Wmaybe-uninitialized warning
glisse at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri May 5 13:09:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635
--- Comment #7 from Marc Glisse <glisse at gcc dot gnu.org> ---
The warning comes from
_Z3setiD.6701 (maybe_a$D6763$m_dummy_6);
which is protected by
_9 = VIEW_CONVERT_EXPR<boolD.2220>(maybe_a$4_7);
if (_9 != 0)
with
# maybe_a$D6763$m_dummy_6 = PHI <maybe_a$D6763$m_dummy_4(D)(6), _5(4)>
# maybe_a$4_7 = PHI <0(6), 1(4)>
In this case, more aggressive threading would kill the possibility to call set
on something undefined (I believe Jeff was already looking into it for other
Wmaybe-uninitialized testcases). The warning is unstable because it depends on
fragile optimization results.
This isn't solvable in general anyway, Wmaybe-uninitialized has "maybe" for a
good reason.
More information about the Gcc-bugs
mailing list