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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmalcolm at gcc dot gnu.org,
                   |                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Seems this is caused by the warning_suppressed_p stuff.
SRA (for whatever reason) disables warnings on the repl decl:
      if (access->grp_no_warning)
        suppress_warning (repl /* Be more selective! */);
      else
        copy_warning (repl, access->base);
    }
  else
    suppress_warning (repl /* Be more selective! */);
So, at that point for the DECL_SOURCE_LOCATION of the SR variable we record all
ones mask.
But later on with -g only tree-ssa-live.cc (clear_unused_block_pointer) decides
to
gimple_set_block (stmt, NULL);
on a debug stmt.
Now, gimple_set_block calls gimple_set_location, which calls copy_warning and
that in this case copies a much narrower mask to a location also used for the
SR variable.

I wonder if all the warning-control stuff shouldn't be avoiding locations with
blocks and only work on LOCATION_LOCUS (loc) instead of loc directly.
And not copy_warning if LOCATION_LOCUS is the same.

Reply via email to