https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83266
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Yibiao Yang from comment #1)
> I am not very sure whether this is a bug or it is only the default behavior
> in gcov.
>
Yes, it's expected. Note that even without any optimization level we do some
folding. And that's reason why 1 > 0 is optimized out.
Thanks for the bug report.