[Bug middle-end/107411] trivial-auto-var-init=zero invalid uninitialized variable warning
qinzhao at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Oct 28 14:15:09 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107411
qinzhao at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |qinzhao at gcc dot gnu.org
--- Comment #3 from qinzhao at gcc dot gnu.org ---
(In reply to Richard Biener from comment #2)
>
> The gimplifier instead of
>
> _1 = t ();
> D.2389 = _1;
> e = &D.2389;
> _2 = *e;
> f (_2);
>
> produces
>
> _1 = .DEFERRED_INIT (4, 2, &"D.2389"[0]);
> D.2389 = _1;
> e = .DEFERRED_INIT (8, 2, &"e"[0]);
> _2 = t ();
> D.2389 = _2;
> e = &D.2389;
> _3 = *e;
> f (_3);
>
> which is odd and sub-optimal at least. Doing such things makes us rely
> on DSE to elide the uninit "inits".
Looks like that "_1 = t ()" was not treated as an initializer, therefore "_1"
was identified as an uninitialized var. "e = &D.2389" has the same issue.
should "_1 = t ()" be treated as an initializer to _1?
More information about the Gcc-bugs
mailing list