[Bug gcov-profile/90438] [GCOV] switch statement is not instrumented when "case" body is empty and only "default" body with statements

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon May 13 06:24:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90438

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
It's again the same story. As I've already explained you multiple times,
compiler optimizes a dead code even without any optimization level. Thus we end
up with:

f (int i)
{
  int res;
  int D.1916;
  int _3;

  <bb 2> :
  res_2 = i_1(D) * 2;

  <bb 3> :
  _3 = res_2;

  <bb 4> :
<L3>:
  return _3;

}

Please do not create such bugs.


More information about the Gcc-bugs mailing list