------- Comment #1 from jakub at gcc dot gnu dot org  2010-07-21 18:00 -------
Another testcase:
extern int v;
extern __typeof (v) v;
extern __typeof (v) v;

When the old extern decl isn't TREE_USED, it doesn't make it into debug info:
    case VAR_DECL:
      /* Ignore this VAR_DECL if it refers to a file-scope extern data object
         declaration and if the declaration was never even referenced from
         within this entire compilation unit.  We suppress these DIEs in
         order to save space in the .debug section (by eliminating entries
         which are probably useless).  Note that we must not suppress
         block-local extern declarations (whether used or not) because that
         would screw-up the debugger's name lookup mechanism and cause it to
         miss things which really ought to be in scope at a given point.  */
      if (DECL_EXTERNAL (decl) && !TREE_USED (decl))
        return;

I wonder if there is any point in keeping TREE_USED set on olddecl after
merge_decls if olddecl was DECL_EXTERNAL.  If there is, other options could be
DECL_IGNORED_P on the DECL_EXTERNAL olddecl, or redirecting it to the newdecl.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |roland at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45020

Reply via email to