This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/80959] -Wreturn-type "control reaches end of non-void function" false positive with -fsanitize=address


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic,
                   |                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-06-02
                 CC|                            |mliska at suse dot cz
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Looks like it is caused by

  try
    {
...
    }
  finally
    {
      ASAN_MARK (POISON, &n, 4);
    }

which eventually gets to

  <bb 5> [0.00%]:
  ASAN_MARK (POISON, &n, 4);
  switch (finally_tmp.2) <default: <L8> [0.00%], case 1: <L5> [0.00%]>

<L5> [0.00%]:

  <bb 7> [0.00%]:
  return;

<L8> [0.00%]:
  return D.2131;

thus it lacks a return.  That's also visible in .original:

{
  int n;

    int n;
  bar (&n);
  switch (i)
    {
      case 1:;
      switch (i)
        {
          default:;
          return 0;
        }
      goto <D.2128>;
      default:;
      return 0;
    }
  <D.2128>:;
}

but I guess that "dead" break; after the inner switch was previously
CFG cleaned-up.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]