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

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
The problem is in this function in gimple-low.c:

    /* Lower a GIMPLE_RETURN GSI.  DATA is passed through the recursion.  */

    static void
    lower_gimple_return (gimple_stmt_iterator *gsi, struct lower_data *data)
    {
      ...

      if (gimple_return_retval (stmt) == gimple_return_retval (tmp_rs.stmt))
        {
          /* Remove the line number from the representative return statement.
             It now fills in for many such returns.  Failure to remove this
             will result in incorrect results for coverage analysis.  */
          gimple_set_location (tmp_rs.stmt, UNKNOWN_LOCATION);

          goto found;
        }
      ...

I wonder if setting the location to the closing curly brace of the function
definition would not cause these failures.  At least the warning would point
into the right function if not the right statement.

Reply via email to