OSDN Git Service

PR debug/36060
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 28 Apr 2008 09:45:26 +0000 (09:45 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 28 Apr 2008 09:45:26 +0000 (09:45 +0000)
* dwarf2out.c (struct die_struct): Mark as chain_circular through
die_sub field.
* gengtype.c (walk_type, write_func_for_structure): Handle
chain_circular.
* doc/gty.texi: Document chain_circular.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134750 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/doc/gty.texi
gcc/dwarf2out.c
gcc/fortran/ChangeLog
gcc/gengtype.c
gcc/testsuite/ChangeLog

index 6d3eec1..b839254 100644 (file)
@@ -1,3 +1,12 @@
+2008-04-28  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/36060
+       * dwarf2out.c (struct die_struct): Mark as chain_circular through
+       die_sub field.
+       * gengtype.c (walk_type, write_func_for_structure): Handle
+       chain_circular.
+       * doc/gty.texi: Document chain_circular.
+
 2008-04-28  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/36066
@@ -78,7 +87,7 @@
        * config/vxworks.c: Include tree.h.
        (vxworks_emutls_var_fields, vxworks_emutls_var_init): New.
        (vxworks_override_options): Set TLS scheme.
-       * gcc/doc/tm.texi (Emulated TLS): New node.
+       * doc/tm.texi (Emulated TLS): New node.
 
 2008-04-26  Simon Baldwin <simonb@google.com>
 
 
 2008-04-01  George Helffrich  <george@gcc.gnu.org>
 
-       PR fortran/PR35154, fortran/PR23057
-       * fortran/trans-common.c (create_common):  Add decl to function
-       chain to preserve identifier scope in debug output.
-
+       PR fortran/35154, fortran/23057
        * dbxout.c: Emit .stabs debug info for Fortran COMMON block
        variables as base symbol name + offset using N_BCOMM/N_ECOMM.
        (is_fortran, dbxout_common_name, dbxout_common_check): New functions.
        (common_check): New function to check whether symbol in Fortran COMMON.
        (gen_variable_die): If COMMON, use DW_TAG_common_block.
 
-       * testsuite/gcc.dg/debug/pr35154.c:  New test to check that non-Fortran
-       use of common is unchanged.
-
-       * testsuite/lib/gfortran-dg.exp:  New harness to compile Fortran progs
-       with all combinations of debug options available on target.
-       * testsuite/gfortran.dg/debug/debug.exp:  Ditto.
-       * testsuite/gfortran.dg/debug/trivial.f:  Ditto.
-       * testsuite/gfortran.dg/debug/pr35154-stabs.f:  New test case for
-       .stabs functionality.
-       * testsuite/gfortran.dg/debug/pr35154-dwarf2.f:  New test case for
-       DWARF functionality.
-
 2008-04-01  Volker Reichelt  <v.reichelt@netcologne.de>
 
        PR c/35436
 
        * config/spu/spu-builtins.def: Fixed wrong parameter type in spu 
        intrinsics spu_convts, spu_convtu, spu_convtf.
-       * testsuite/gcc.target/spu/intrinsics-3.c: New. Test error messages.
 
 2008-02-08  Hans-Peter Nilsson  <hp@axis.com>
 
index 2ffa151..c063d01 100644 (file)
@@ -316,8 +316,10 @@ escape.
 
 @findex chain_next
 @findex chain_prev
+@findex chain_circular
 @item chain_next ("@var{expression}")
 @itemx chain_prev ("@var{expression}")
+@itemx chain_circular ("@var{expression}")
 
 It's helpful for the type machinery to know if objects are often
 chained together in long lists; this lets it generate code that uses
@@ -326,7 +328,8 @@ it.  @code{chain_next} is an expression for the next item in the list,
 @code{chain_prev} is an expression for the previous item.  For singly
 linked lists, use only @code{chain_next}; for doubly linked lists, use
 both.  The machinery requires that taking the next item of the
-previous item gives the original item.
+previous item gives the original item.  @code{chain_circular} is similar
+to @code{chain_next}, but can be used for circular single linked lists.
 
 @findex reorder
 @item reorder ("@var{function name}")
index 83b3fb5..cdf5250 100644 (file)
@@ -3837,7 +3837,7 @@ DEF_VEC_ALLOC_O(dw_attr_node,gc);
    The children of each node form a circular list linked by
    die_sib.  die_child points to the node *before* the "first" child node.  */
 
-typedef struct die_struct GTY(())
+typedef struct die_struct GTY((chain_circular ("%h.die_sib")))
 {
   enum dwarf_tag die_tag;
   char *die_symbol;
index dbe52c3..84e8f7b 100644 (file)
 
 2008-04-01  George Helffrich <george@gcc.gnu.org>
 
+       PR fortran/35154, fortran/23057
        * trans-common.c (create_common):  Add decl to function
        chain to preserve identifier scope in debug output.
 
index bce0c3d..aef52e2 100644 (file)
@@ -1937,6 +1937,8 @@ walk_type (type_p t, struct walk_type_data *d)
       ;
     else if (strcmp (oo->name, "chain_prev") == 0)
       ;
+    else if (strcmp (oo->name, "chain_circular") == 0)
+      ;
     else if (strcmp (oo->name, "reorder") == 0)
       ;
     else
@@ -2414,6 +2416,7 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
   int i;
   const char *chain_next = NULL;
   const char *chain_prev = NULL;
+  const char *chain_circular = NULL;
   const char *mark_hook_name = NULL;
   options_p opt;
   struct walk_type_data d;
@@ -2432,11 +2435,17 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
       chain_next = opt->info;
     else if (strcmp (opt->name, "chain_prev") == 0)
       chain_prev = opt->info;
+    else if (strcmp (opt->name, "chain_circular") == 0)
+      chain_circular = opt->info;
     else if (strcmp (opt->name, "mark_hook") == 0)
       mark_hook_name = opt->info;
 
   if (chain_prev != NULL && chain_next == NULL)
     error_at_line (&s->u.s.line, "chain_prev without chain_next");
+  if (chain_circular != NULL && chain_next != NULL)
+    error_at_line (&s->u.s.line, "chain_circular with chain_next");
+  if (chain_circular != NULL)
+    chain_next = chain_circular;
 
   d.process_field = write_types_process_field;
   d.cookie = wtd;
@@ -2481,7 +2490,10 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
     }
   else
     {
-      oprintf (d.of, "  while (%s (xlimit", wtd->marker_routine);
+      if (chain_circular != NULL)
+       oprintf (d.of, "  if (!%s (xlimit", wtd->marker_routine);
+      else
+       oprintf (d.of, "  while (%s (xlimit", wtd->marker_routine);
       if (wtd->param_prefix)
        {
          oprintf (d.of, ", xlimit, gt_%s_", wtd->param_prefix);
@@ -2489,6 +2501,8 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
          output_type_enum (d.of, orig_s);
        }
       oprintf (d.of, "))\n");
+      if (chain_circular != NULL)
+       oprintf (d.of, "    return;\n  do\n");
       if (mark_hook_name && !wtd->skip_hooks)
        {
          oprintf (d.of, "    {\n");
@@ -2524,7 +2538,22 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
          oprintf (d.of, ");\n");
          oprintf (d.of, "      }\n");
        }
-      oprintf (d.of, "  while (x != xlimit)\n");
+      if (chain_circular != NULL)
+       {
+         oprintf (d.of, "  while (%s (xlimit", wtd->marker_routine);
+         if (wtd->param_prefix)
+           {
+             oprintf (d.of, ", xlimit, gt_%s_", wtd->param_prefix);
+             output_mangled_typename (d.of, orig_s);
+             output_type_enum (d.of, orig_s);
+           }
+         oprintf (d.of, "));\n");
+         if (mark_hook_name && !wtd->skip_hooks)
+           oprintf (d.of, "  %s (xlimit);\n", mark_hook_name);
+         oprintf (d.of, "  do\n");
+       }
+      else
+       oprintf (d.of, "  while (x != xlimit)\n");
     }
   oprintf (d.of, "    {\n");
   if (mark_hook_name && chain_next == NULL && !wtd->skip_hooks)
@@ -2543,6 +2572,8 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
     }
 
   oprintf (d.of, "    }\n");
+  if (chain_circular != NULL)
+    oprintf (d.of, "  while (x != xlimit);\n");
   oprintf (d.of, "}\n");
 }
 
index c15f973..70a716a 100644 (file)
 
 2008-04-01  George Helffrich  <george@gcc.gnu.org>
 
-       PRs fortran/PR35154, fortran/PR23057
+       PRs fortran/35154, fortran/23057
        * gcc.dg/debug/pr35154.c:  New test to check that non-Fortran
        use of common is unchanged.
 
        PR objc++/34193
        * obj-c++.dg/gnu-runtime-2.mm: Fix signature of function main().
 
+2008-02-08  Sa Liu  <saliu@de.ibm.com>
+
+       * gcc.target/spu/intrinsics-3.c: New. Test error messages.
+
 2008-02-06  Alexandre Oliva  <aoliva@redhat.com>
 
        PR c++/35056