public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix parts of PR46808
@ 2010-12-10 15:46 Richard Guenther
  0 siblings, 0 replies; only message in thread
From: Richard Guenther @ 2010-12-10 15:46 UTC (permalink / raw)
  To: gcc-patches


Currently we emit a type mismatch warning after erroring on overriding
a function with a variable at lto symtab merging time.  The warning
is spurious, fixed with the following patch.

Bootstrap and regtest on x86_64-unknown-linux-gnu, will apply if that
succeeds.

Thanks,
Richard.

2010-12-10  Richard Guenther  <rguenther@suse.de>

	PR lto/46808
	* lto-symtab.c (lto_symtab_merge_decls_2): Avoid type warnings
	after errors.
	(lto_symtab_merge_decls_1): Adjust.

Index: gcc/lto-symtab.c
===================================================================
*** gcc/lto-symtab.c	(revision 167686)
--- gcc/lto-symtab.c	(working copy)
*************** found:
*** 590,605 ****
  }
  
  /* Merge all decls in the symbol table chain to the prevailing decl and
!    issue diagnostics about type mismatches.  */
  
  static void
! lto_symtab_merge_decls_2 (void **slot)
  {
    lto_symtab_entry_t prevailing, e;
    VEC(tree, heap) *mismatches = NULL;
    unsigned i;
    tree decl;
-   bool diagnosed_p = false;
  
    /* Nothing to do for a single entry.  */
    prevailing = (lto_symtab_entry_t) *slot;
--- 590,605 ----
  }
  
  /* Merge all decls in the symbol table chain to the prevailing decl and
!    issue diagnostics about type mismatches.  If DIAGNOSED_P is true
!    do not issue further diagnostics.*/
  
  static void
! lto_symtab_merge_decls_2 (void **slot, bool diagnosed_p)
  {
    lto_symtab_entry_t prevailing, e;
    VEC(tree, heap) *mismatches = NULL;
    unsigned i;
    tree decl;
  
    /* Nothing to do for a single entry.  */
    prevailing = (lto_symtab_entry_t) *slot;
*************** lto_symtab_merge_decls_2 (void **slot)
*** 609,615 ****
    /* Try to merge each entry with the prevailing one.  */
    for (e = prevailing->next; e; e = e->next)
      {
!       if (!lto_symtab_merge (prevailing, e))
  	VEC_safe_push (tree, heap, mismatches, e->decl);
      }
    if (VEC_empty (tree, mismatches))
--- 609,616 ----
    /* Try to merge each entry with the prevailing one.  */
    for (e = prevailing->next; e; e = e->next)
      {
!       if (!lto_symtab_merge (prevailing, e)
! 	  && !diagnosed_p)
  	VEC_safe_push (tree, heap, mismatches, e->decl);
      }
    if (VEC_empty (tree, mismatches))
*************** lto_symtab_merge_decls_1 (void **slot, v
*** 748,759 ****
  
    /* Merge the chain to the single prevailing decl and diagnose
       mismatches.  */
!   lto_symtab_merge_decls_2 (slot);
! 
!   /* Drop all but the prevailing decl from the symtab.  */
!   if (TREE_CODE (prevailing->decl) != FUNCTION_DECL
!       && TREE_CODE (prevailing->decl) != VAR_DECL)
!     prevailing->next = NULL;
  
    /* Store resolution decision into the callgraph.  
       In LTRANS don't overwrite information we stored into callgraph at
--- 749,755 ----
  
    /* Merge the chain to the single prevailing decl and diagnose
       mismatches.  */
!   lto_symtab_merge_decls_2 (slot, diagnosed_p);
  
    /* Store resolution decision into the callgraph.  
       In LTRANS don't overwrite information we stored into callgraph at

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-10 14:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-10 15:46 [PATCH] Fix parts of PR46808 Richard Guenther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).