*PING*

On 05.11.20 22:57, Tobias Burnus wrote:
In gfc_get_symbol_decl, if an external procedure is invoked
and sym->backend_decl is NULL_TREE,
  gfc_get_extern_function_decl
is called. This searches the translation unit (or gsym) to
find the declaration – and if found, it returns it.

Well, that worked and the module procedure's decl is returned
with DECL_SOURCE_LOCATION() matching the original declaration
and the associated cfun->function_end_location is also properly
set.

But before this patch, the location is reset to the sym->declared_at,
which is the location of the "use foo" line in the example from
the PR.

Result: The DECL_SOURCE_LOCATION(cfun->decl) is *after*
cfun->function_end_location, which runs with --coverage
into an assert.


The other changes to BIND_EXPR is unrelated. It was just that
I did run with '-fdump-tree-original-lineno' and got:

  foo_suite ()
  [coverage.f90:17:22] {
    integer(kind=4) res;

    [coverage.f90:16:17] res = bar ([coverage.f90:16:17] sbr);
  }

Where line 17 for '{' looked odd. With the patch, we now have:

  foo_suite ()
  [coverage.f90:12:0] {
    integer(kind=4) res;

    [coverage.f90:16:17] res = bar ([coverage.f90:16:17] sbr);
  }


OK for the trunk?

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander 
Walter

Reply via email to