This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH for PR 18279


This fixes a regression introduced in 4.x when we merged from
tree-ssa. 

-- Gaby
 
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 2.9322
diff -p -r2.9322 ChangeLog
*** ChangeLog	3 Jul 2005 00:38:05 -0000	2.9322
--- ChangeLog	3 Jul 2005 01:13:09 -0000
***************
*** 1,3 ****
--- 1,15 ----
+ 2005-07-02  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+             Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
+ 
+ 	PR c++/18279
+ 	* c-decl.c (c_write_global_declarations): Dump contents of
+ 	external scope to.
+ 	* tree-dump.c (dequeue_and_dump): Dump abstract origin of a decl.
+ 	<TRY_FINALLY_EXPR>, <RETURN_EXPR>, <CASE_LABEL_EXPR>, <LABEL_EXPR>,
+ 	<GOTO_EXPR>, <SWITCH_EXPR>: Add.
+ 	(dump_enabled_p): Return TRUE if PHASE is TDI_all and any dump
+ 	is enabled.
+ 	
  2005-07-03  Joseph S. Myers  <joseph@codesourcery.com>
  
  	* c-common.h (GCC_DIAG_STYLE): Define.
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.671
diff -p -r1.671 c-decl.c
*** c-decl.c	2 Jul 2005 10:54:06 -0000	1.671
--- c-decl.c	3 Jul 2005 01:13:10 -0000
*************** c_write_global_declarations (void)
*** 7541,7546 ****
--- 7541,7557 ----
       through wrapup_global_declarations and check_global_declarations.  */
    for (t = all_translation_units; t; t = TREE_CHAIN (t))
      c_write_global_declarations_1 (BLOCK_VARS (DECL_INITIAL (t)));
+   if (ext_block)
+     {
+       tree tmp = BLOCK_VARS (ext_block);
+       int flags;
+       FILE * stream = dump_begin (TDI_tu, &flags);
+       if (stream && tmp)
+         {
+           dump_node (tmp, flags & ~TDF_SLIM, stream);
+           dump_end (TDI_tu, stream);
+         }
+     }
    c_write_global_declarations_1 (BLOCK_VARS (ext_block));
  
    /* Generate functions to call static constructors and destructors
Index: tree-dump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-dump.c,v
retrieving revision 1.43
diff -p -r1.43 tree-dump.c
*** tree-dump.c	25 Jun 2005 02:01:20 -0000	1.43
--- tree-dump.c	3 Jul 2005 01:13:10 -0000
*************** dequeue_and_dump (dump_info_p di)
*** 322,327 ****
--- 322,329 ----
        if (DECL_ASSEMBLER_NAME_SET_P (t)
  	  && DECL_ASSEMBLER_NAME (t) != DECL_NAME (t))
  	dump_child ("mngl", DECL_ASSEMBLER_NAME (t));
+       if (DECL_ABSTRACT_ORIGIN (t))
+         dump_child ("orig", DECL_ABSTRACT_ORIGIN (t));
        /* And types.  */
        queue_and_dump_type (di, t);
        dump_child ("scpe", DECL_CONTEXT (t));
*************** dequeue_and_dump (dump_info_p di)
*** 572,577 ****
--- 574,584 ----
        dump_child ("op 2", TREE_OPERAND (t, 2));
        break;
  
+     case TRY_FINALLY_EXPR:
+       dump_child ("op 0", TREE_OPERAND (t, 0));
+       dump_child ("op 1", TREE_OPERAND (t, 1));
+       break;
+ 
      case CALL_EXPR:
        dump_child ("fn", TREE_OPERAND (t, 0));
        dump_child ("args", TREE_OPERAND (t, 1));
*************** dequeue_and_dump (dump_info_p di)
*** 594,599 ****
--- 601,610 ----
        dump_child ("cond", TREE_OPERAND (t, 0));
        break;
  
+     case RETURN_EXPR:
+       dump_child ("expr", TREE_OPERAND (t, 0));
+       break;
+ 
      case TARGET_EXPR:
        dump_child ("decl", TREE_OPERAND (t, 0));
        dump_child ("init", TREE_OPERAND (t, 1));
*************** dequeue_and_dump (dump_info_p di)
*** 605,610 ****
--- 616,644 ----
        dump_child ("init", TREE_OPERAND (t, 3));
        break;
  
+     case CASE_LABEL_EXPR:
+       dump_child ("name", CASE_LABEL (t));
+       if (CASE_LOW (t)) {
+         dump_child ("low ", CASE_LOW (t));
+ 	if (CASE_HIGH (t)) {
+ 	  dump_child ("high", CASE_HIGH (t));
+ 	}
+       }
+       break;
+     case LABEL_EXPR:
+       dump_child ("name", TREE_OPERAND (t,0));
+       break;
+     case GOTO_EXPR:
+       dump_child ("labl", TREE_OPERAND (t, 0));
+       break;
+     case SWITCH_EXPR:
+       dump_child ("cond", TREE_OPERAND (t, 0));
+       dump_child ("body", TREE_OPERAND (t, 1));
+       if (TREE_OPERAND (t, 2))
+         {
+       	  dump_child ("labl", TREE_OPERAND (t,2));
+         }
+       break;
      default:
        /* There are no additional fields to print.  */
        break;
*************** dump_begin (enum tree_dump_index phase, 
*** 859,871 ****
    return stream;
  }
  
! /* Returns nonzero if tree dump PHASE is enabled.  */
  
  int
  dump_enabled_p (enum tree_dump_index phase)
  {
!   struct dump_file_info *dfi = get_dump_file_info (phase);
!   return dfi->state;
  }
  
  /* Returns nonzero if tree dump PHASE has been initialized.  */
--- 893,920 ----
    return stream;
  }
  
! /* Returns nonzero if tree dump PHASE is enabled.  If PHASE is
!    TDI_tree_all, return nonzero if any dump is enabled.  */
  
  int
  dump_enabled_p (enum tree_dump_index phase)
  {
!   if (phase == TDI_tree_all)
!     {
!       size_t i;
!       for (i = TDI_none + 1; i < (size_t) TDI_end; i++)
! 	if (dump_files[i].state)
! 	  return 1;
!       for (i = 0; i < extra_dump_files_in_use; i++)
! 	if (extra_dump_files[i].state)
! 	  return 1;
!       return 0;
!     }
!   else
!     {
!       struct dump_file_info *dfi = get_dump_file_info (phase);
!       return dfi->state;
!     }
  }
  
  /* Returns nonzero if tree dump PHASE has been initialized.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]