re PR debug/36060 (Too big stack requirements of cc1plus during GC)
authorJakub Jelinek <jakub@gcc.gnu.org>
Mon, 28 Apr 2008 09:45:26 +0000 (11:45 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 28 Apr 2008 09:45:26 +0000 (11:45 +0200)
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.

From-SVN: r134750

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

index 6d3eec1e864bea4a0f0feb86391c3f4e99ff471f..b8392545ac5b6b67fed34c9a75b294062eca92f2 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 2ffa15194298a4195a66bc9fe5add09674c2a76b..c063d0184e3223abf4f0fbde1e9378d8784e6a62 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 83b3fb5aa83718eb5b8368869176d4a22eb85d3c..cdf5250b49d9b75311fc67c3e453381d57d958e7 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 dbe52c3ff1a854f94e7923c5d11fa7cddc97ba61..84e8f7b0128209cf021630bf59bb012b5827414c 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 bce0c3df79fd2884c5d341fbc65f64e55f01cd4b..aef52e2cdca571fe7e9b50ab941ff7a3462a96e7 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 c15f9739ac66ddaff065153a7e763b620d3c8020..70a716a69074582381e1521fd70666e18a25c905 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