[Bug middle-end/56977] gcc -Og incorrectly warns about 'constant zero length parameter'
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jun 17 10:09:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56977
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2013-06-17
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
Target Milestone|--- |4.8.2
Ever confirmed|0 |1
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Interesting because we do fold the call and end up with
f (int i)
{
int _3;
<bb 2>:
_3 = 0;
if (_3 != 0)
goto <bb 3>;
else
goto <bb 4>;
<bb 3>:
error ();
<bb 4>:
return;
where the zero does not end up being propagated into the conditional
at any point further down into the compilation ... (TER is disabled
which is what usually saves us here).
A simple solution is to exchange pass_fold_builtins and pass_dce in
pass_all_optimizations_g.
More information about the Gcc-bugs
mailing list