public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Call free_after_parsing earlier
@ 2012-07-11 19:40 Steven Bosscher
  2012-07-12  7:21 ` Richard Guenther
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Bosscher @ 2012-07-11 19:40 UTC (permalink / raw)
  To: GCC Patches

Hello,

GCC calls free_after_parsing in rest_of_clean_state.
That's way too late, it can be done in free_lang_data_in_cgraph instead.

While there, I noticed a silly loop in final.c, and cleaned that up too.

Bootstrapped&tested on x86_64-unknown-linux-gnu. OK for trunk?

Ciao!
Steven

        * final.c (final): Don't loop to find max_uid.
        (rest_of_clean_state): Don't call free_after_parsing here.
        * tree.c (free_lang_data_in_cgraph): Call free_after_parsing here.

Index: final.c
===================================================================
--- final.c     (revision 189423)
+++ final.c     (working copy)
@@ -1826,7 +1826,6 @@ void
 final (rtx first, FILE *file, int optimize_p)
 {
   rtx insn, next;
-  int max_uid = 0;
   int seen = 0;

   /* Used for -dA dump.  */
@@ -1837,11 +1836,9 @@ final (rtx first, FILE *file, int optimi

   last_ignored_compare = 0;

+#ifdef HAVE_cc0
   for (insn = first; insn; insn = NEXT_INSN (insn))
     {
-      if (INSN_UID (insn) > max_uid)       /* Find largest UID.  */
-       max_uid = INSN_UID (insn);
-#ifdef HAVE_cc0
       /* If CC tracking across branches is enabled, record the insn which
         jumps to each branch only reached from one place.  */
       if (optimize_p && JUMP_P (insn))
@@ -1852,8 +1849,8 @@ final (rtx first, FILE *file, int optimi
              LABEL_REFS (lab) = insn;
            }
        }
-#endif
     }
+#endif

   init_recog ();

@@ -4500,7 +4497,6 @@ rest_of_clean_state (void)
   init_recog_no_volatile ();

   /* We're done with this function.  Free up memory if we can.  */
-  free_after_parsing (cfun);
   free_after_compilation (cfun);
   return 0;
 }
Index: tree.c
===================================================================
--- tree.c      (revision 189423)
+++ tree.c      (working copy)
@@ -5167,16 +5167,19 @@ assign_assembler_name_if_neeeded (tree t


 /* Free language specific information for every operand and expression
-   in every node of the call graph.  This process operates in three stages:
+   in every node of the call graph.  This process operates in four stages:

-   1- Every callgraph node and varpool node is traversed looking for
+   1- Every function is traversed to free any front-end specific
+      data hung from the function's struct function->language.
+
+   2- Every callgraph node and varpool node is traversed looking for
       decls and types embedded in them.  This is a more exhaustive
       search than that done by find_referenced_vars, because it will
       also collect individual fields, decls embedded in types, etc.

-   2- All the decls found are sent to free_lang_data_in_decl.
+   3- All the decls found are sent to free_lang_data_in_decl.

-   3- All the types found are sent to free_lang_data_in_type.
+   4- All the types found are sent to free_lang_data_in_type.

    The ordering between decls and types is important because
    free_lang_data_in_decl sets assembler names, which includes
@@ -5193,6 +5196,10 @@ free_lang_data_in_cgraph (void)
   unsigned i;
   alias_pair *p;

+  /* Clear out function->language.  */
+  FOR_EACH_FUNCTION (n)
+    free_after_parsing (DECL_STRUCT_FUNCTION (n->symbol.decl));
+
   /* Initialize sets and arrays to store referenced decls and types.  */
   fld.pset = pointer_set_create ();
   fld.worklist = NULL;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Call free_after_parsing earlier
  2012-07-11 19:40 [patch] Call free_after_parsing earlier Steven Bosscher
@ 2012-07-12  7:21 ` Richard Guenther
  2012-07-13 14:33   ` Steven Bosscher
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Guenther @ 2012-07-12  7:21 UTC (permalink / raw)
  To: Steven Bosscher; +Cc: GCC Patches

On Wed, Jul 11, 2012 at 9:39 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> Hello,
>
> GCC calls free_after_parsing in rest_of_clean_state.
> That's way too late, it can be done in free_lang_data_in_cgraph instead.

But that's only called with -flto ... I think it should be called in
cgraph_finalize_function instead (being optimistic here - heh).

Richard.

> While there, I noticed a silly loop in final.c, and cleaned that up too.
>
> Bootstrapped&tested on x86_64-unknown-linux-gnu. OK for trunk?
>
> Ciao!
> Steven
>
>         * final.c (final): Don't loop to find max_uid.
>         (rest_of_clean_state): Don't call free_after_parsing here.
>         * tree.c (free_lang_data_in_cgraph): Call free_after_parsing here.
>
> Index: final.c
> ===================================================================
> --- final.c     (revision 189423)
> +++ final.c     (working copy)
> @@ -1826,7 +1826,6 @@ void
>  final (rtx first, FILE *file, int optimize_p)
>  {
>    rtx insn, next;
> -  int max_uid = 0;
>    int seen = 0;
>
>    /* Used for -dA dump.  */
> @@ -1837,11 +1836,9 @@ final (rtx first, FILE *file, int optimi
>
>    last_ignored_compare = 0;
>
> +#ifdef HAVE_cc0
>    for (insn = first; insn; insn = NEXT_INSN (insn))
>      {
> -      if (INSN_UID (insn) > max_uid)       /* Find largest UID.  */
> -       max_uid = INSN_UID (insn);
> -#ifdef HAVE_cc0
>        /* If CC tracking across branches is enabled, record the insn which
>          jumps to each branch only reached from one place.  */
>        if (optimize_p && JUMP_P (insn))
> @@ -1852,8 +1849,8 @@ final (rtx first, FILE *file, int optimi
>               LABEL_REFS (lab) = insn;
>             }
>         }
> -#endif
>      }
> +#endif
>
>    init_recog ();
>
> @@ -4500,7 +4497,6 @@ rest_of_clean_state (void)
>    init_recog_no_volatile ();
>
>    /* We're done with this function.  Free up memory if we can.  */
> -  free_after_parsing (cfun);
>    free_after_compilation (cfun);
>    return 0;
>  }
> Index: tree.c
> ===================================================================
> --- tree.c      (revision 189423)
> +++ tree.c      (working copy)
> @@ -5167,16 +5167,19 @@ assign_assembler_name_if_neeeded (tree t
>
>
>  /* Free language specific information for every operand and expression
> -   in every node of the call graph.  This process operates in three stages:
> +   in every node of the call graph.  This process operates in four stages:
>
> -   1- Every callgraph node and varpool node is traversed looking for
> +   1- Every function is traversed to free any front-end specific
> +      data hung from the function's struct function->language.
> +
> +   2- Every callgraph node and varpool node is traversed looking for
>        decls and types embedded in them.  This is a more exhaustive
>        search than that done by find_referenced_vars, because it will
>        also collect individual fields, decls embedded in types, etc.
>
> -   2- All the decls found are sent to free_lang_data_in_decl.
> +   3- All the decls found are sent to free_lang_data_in_decl.
>
> -   3- All the types found are sent to free_lang_data_in_type.
> +   4- All the types found are sent to free_lang_data_in_type.
>
>     The ordering between decls and types is important because
>     free_lang_data_in_decl sets assembler names, which includes
> @@ -5193,6 +5196,10 @@ free_lang_data_in_cgraph (void)
>    unsigned i;
>    alias_pair *p;
>
> +  /* Clear out function->language.  */
> +  FOR_EACH_FUNCTION (n)
> +    free_after_parsing (DECL_STRUCT_FUNCTION (n->symbol.decl));
> +
>    /* Initialize sets and arrays to store referenced decls and types.  */
>    fld.pset = pointer_set_create ();
>    fld.worklist = NULL;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Call free_after_parsing earlier
  2012-07-12  7:21 ` Richard Guenther
@ 2012-07-13 14:33   ` Steven Bosscher
  2012-07-16  9:07     ` Richard Guenther
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Bosscher @ 2012-07-13 14:33 UTC (permalink / raw)
  To: Richard Guenther; +Cc: GCC Patches

On Thu, Jul 12, 2012 at 9:21 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Wed, Jul 11, 2012 at 9:39 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
>> Hello,
>>
>> GCC calls free_after_parsing in rest_of_clean_state.
>> That's way too late, it can be done in free_lang_data_in_cgraph instead.
>
> But that's only called with -flto ... I think it should be called in
> cgraph_finalize_function instead (being optimistic here - heh).

Quite optimistic, indeed...

I choose for free_lang_data_in_cgraph (which, BTW, doesn't belong in
tree.c, but that aside) because I thought the C++ front end might need
its function->language after cgraph_finalize_function. And indeed
so...

Ciao!
Steven


$ cat t.C
#line 14971 "configure"
struct S { ~S(); };
void bar();
void foo()
{
  S s;
  bar();
}

$ gdb --args ./cc1plus t.C
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
Breakpoint 1 at 0x38a80b5: file ../../trunk/gcc/diagnostic.c, line 1011.
Breakpoint 2 at 0x38a7ed6: file ../../trunk/gcc/diagnostic.c, line 955.
Function "exit" not defined.
Make breakpoint pending on future shared library load? (y or [n])
[answered N; input not from terminal]
Function "abort" not defined.
Make breakpoint pending on future shared library load? (y or [n])
[answered N; input not from terminal]
(gdb) run
Starting program: /home/stevenb/devel/build-test/gcc/cc1plus t.C
 void foo()
Analyzing compilation unit

Program received signal SIGSEGV, Segmentation fault.
0x000000000096b93a in stmts_are_full_exprs_p () at
../../trunk/gcc/cp/semantics.c:370
370       return current_stmt_tree ()->stmts_are_full_exprs_p;
(gdb) bt
#0  0x000000000096b93a in stmts_are_full_exprs_p () at
../../trunk/gcc/cp/semantics.c:370
#1  0x0000000000b1f294 in cp_gimplify_expr (expr_p=0x7ffff7232a20,
pre_p=0x7fffffff97a8, post_p=0x7fffffff8ba8) at
../../trunk/gcc/cp/cp-gimplify.c:530
#2  0x000000000156fb44 in gimplify_expr (expr_p=0x7ffff7232a20,
pre_p=0x7fffffff97a8, post_p=0x7fffffff8ba8, gimple_test_f=0x155d16c
<is_gimple_stmt>, fallback=0)
    at ../../trunk/gcc/gimplify.c:7064
#3  0x0000000001563bb7 in gimplify_stmt (stmt_p=0x7ffff7232a20,
seq_p=0x7fffffff97a8) at ../../trunk/gcc/gimplify.c:5678
#4  0x0000000001562d43 in gimplify_cleanup_point_expr
(expr_p=0x7ffff7245ad8, pre_p=0x7fffffffb3b0) at
../../trunk/gcc/gimplify.c:5455
#5  0x0000000001572c33 in gimplify_expr (expr_p=0x7ffff7245ad8,
pre_p=0x7fffffffb3b0, post_p=0x7fffffff9998, gimple_test_f=0x155d16c
<is_gimple_stmt>, fallback=0)
    at ../../trunk/gcc/gimplify.c:7479
#6  0x0000000001563bb7 in gimplify_stmt (stmt_p=0x7ffff7245ad8,
seq_p=0x7fffffffb3b0) at ../../trunk/gcc/gimplify.c:5678
#7  0x0000000001543e69 in gimplify_statement_list
(expr_p=0x7fffffffb288, pre_p=0x7fffffffb3b0) at
../../trunk/gcc/gimplify.c:1527
#8  0x000000000157352f in gimplify_expr (expr_p=0x7fffffffb288,
pre_p=0x7fffffffb3b0, post_p=0x7fffffffa6e8, gimple_test_f=0x155d16c
<is_gimple_stmt>, fallback=0)
    at ../../trunk/gcc/gimplify.c:7531
#9  0x0000000001563bb7 in gimplify_stmt (stmt_p=0x7fffffffb288,
seq_p=0x7fffffffb3b0) at ../../trunk/gcc/gimplify.c:5678
#10 0x000000000153eb49 in gimplify_and_add (t=0x7ffff7247600,
seq_p=0x7fffffffb3b0) at ../../trunk/gcc/gimplify.c:358
#11 0x0000000001572a22 in gimplify_expr (expr_p=0x7ffff7245ac0,
pre_p=0x7fffffffcd40, post_p=0x7fffffffb3f8, gimple_test_f=0x155d16c
<is_gimple_stmt>, fallback=0)
    at ../../trunk/gcc/gimplify.c:7457
#12 0x0000000001563bb7 in gimplify_stmt (stmt_p=0x7ffff7245ac0,
seq_p=0x7fffffffcd40) at ../../trunk/gcc/gimplify.c:5678
#13 0x0000000001543e69 in gimplify_statement_list
(expr_p=0x7ffff724c098, pre_p=0x7fffffffcd40) at
../../trunk/gcc/gimplify.c:1527
#14 0x000000000157352f in gimplify_expr (expr_p=0x7ffff724c098,
pre_p=0x7fffffffcd40, post_p=0x7fffffffc148, gimple_test_f=0x155d16c
<is_gimple_stmt>, fallback=0)
    at ../../trunk/gcc/gimplify.c:7531
#15 0x0000000001563bb7 in gimplify_stmt (stmt_p=0x7ffff724c098,
seq_p=0x7fffffffcd40) at ../../trunk/gcc/gimplify.c:5678
#16 0x0000000001542106 in gimplify_bind_expr (expr_p=0x7ffff723c898,
pre_p=0x7fffffffdc80) at ../../trunk/gcc/gimplify.c:1220
#17 0x0000000001571446 in gimplify_expr (expr_p=0x7ffff723c898,
pre_p=0x7fffffffdc80, post_p=0x7fffffffd068, gimple_test_f=0x155d16c
<is_gimple_stmt>, fallback=0)
    at ../../trunk/gcc/gimplify.c:7316
#18 0x0000000001563bb7 in gimplify_stmt (stmt_p=0x7ffff723c898,
seq_p=0x7fffffffdc80) at ../../trunk/gcc/gimplify.c:5678
#19 0x0000000001577766 in gimplify_body (fndecl=0x7ffff723c800,
do_parms=1 '\001') at ../../trunk/gcc/gimplify.c:8177
#20 0x0000000001578d36 in gimplify_function_tree
(fndecl=0x7ffff723c800) at ../../trunk/gcc/gimplify.c:8311
#21 0x0000000000fc490c in cgraph_analyze_function
(node=0x7ffff70d5750) at ../../trunk/gcc/cgraphunit.c:658
#22 0x0000000000fc5c13 in cgraph_analyze_functions () at
../../trunk/gcc/cgraphunit.c:944
#23 0x0000000000fc9a19 in finalize_compilation_unit () at
../../trunk/gcc/cgraphunit.c:2092
#24 0x0000000000748909 in cp_write_global_declarations () at
../../trunk/gcc/cp/decl2.c:4024
#25 0x0000000001eace3e in compile_file () at ../../trunk/gcc/toplev.c:560
#26 0x0000000001eaecff in do_compile () at ../../trunk/gcc/toplev.c:1863
#27 0x0000000001eaee54 in toplev_main (argc=2, argv=0x7fffffffe2b8) at
../../trunk/gcc/toplev.c:1939
#28 0x00000000038889a1 in main (argc=2, argv=0x7fffffffe2b8) at
../../trunk/gcc/main.c:36



Index: final.c
===================================================================
--- final.c     (revision 189459)
+++ final.c     (working copy)
@@ -1826,7 +1826,6 @@ void
 final (rtx first, FILE *file, int optimize_p)
 {
   rtx insn, next;
-  int max_uid = 0;
   int seen = 0;

   /* Used for -dA dump.  */
@@ -1837,11 +1836,9 @@ final (rtx first, FILE *file, int optimi

   last_ignored_compare = 0;

+#ifdef HAVE_cc0
   for (insn = first; insn; insn = NEXT_INSN (insn))
     {
-      if (INSN_UID (insn) > max_uid)       /* Find largest UID.  */
-       max_uid = INSN_UID (insn);
-#ifdef HAVE_cc0
       /* If CC tracking across branches is enabled, record the insn which
         jumps to each branch only reached from one place.  */
       if (optimize_p && JUMP_P (insn))
@@ -1852,8 +1849,8 @@ final (rtx first, FILE *file, int optimi
              LABEL_REFS (lab) = insn;
            }
        }
-#endif
     }
+#endif

   init_recog ();

@@ -4500,7 +4497,6 @@ rest_of_clean_state (void)
   init_recog_no_volatile ();

   /* We're done with this function.  Free up memory if we can.  */
-  free_after_parsing (cfun);
   free_after_compilation (cfun);
   return 0;
 }
Index: cgraphunit.c
===================================================================
--- cgraphunit.c        (revision 189459)
+++ cgraphunit.c        (working copy)
@@ -404,6 +404,12 @@ cgraph_finalize_function (tree decl, boo
 {
   struct cgraph_node *node = cgraph_get_create_node (decl);

+  /* The front end is done with this function.  Free up memory if we can.  */
+  if (DECL_STRUCT_FUNCTION (decl))
+    free_after_parsing (DECL_STRUCT_FUNCTION (decl));
+
+  /* If this node was finalized before, this must be a re-definition for
+     an extern inline.  */
   if (node->local.finalized)
     {
       cgraph_reset_node (node);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] Call free_after_parsing earlier
  2012-07-13 14:33   ` Steven Bosscher
@ 2012-07-16  9:07     ` Richard Guenther
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Guenther @ 2012-07-16  9:07 UTC (permalink / raw)
  To: Steven Bosscher; +Cc: GCC Patches

On Fri, Jul 13, 2012 at 4:33 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> On Thu, Jul 12, 2012 at 9:21 AM, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>> On Wed, Jul 11, 2012 at 9:39 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
>>> Hello,
>>>
>>> GCC calls free_after_parsing in rest_of_clean_state.
>>> That's way too late, it can be done in free_lang_data_in_cgraph instead.
>>
>> But that's only called with -flto ... I think it should be called in
>> cgraph_finalize_function instead (being optimistic here - heh).
>
> Quite optimistic, indeed...

;)

Btw, the

* final.c (final): Don't loop to find max_uid.

part is ok if you want to commit it separately.

> I choose for free_lang_data_in_cgraph (which, BTW, doesn't belong in
> tree.c, but that aside) because I thought the C++ front end might need
> its function->language after cgraph_finalize_function. And indeed
> so...

Ok, so how about doing it at the end of cgraph_analyze_function?

Thanks,
Richard.

> Ciao!
> Steven
>
>
> $ cat t.C
> #line 14971 "configure"
> struct S { ~S(); };
> void bar();
> void foo()
> {
>   S s;
>   bar();
> }
>
> $ gdb --args ./cc1plus t.C
> GNU gdb 6.8-debian
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu"...
> Breakpoint 1 at 0x38a80b5: file ../../trunk/gcc/diagnostic.c, line 1011.
> Breakpoint 2 at 0x38a7ed6: file ../../trunk/gcc/diagnostic.c, line 955.
> Function "exit" not defined.
> Make breakpoint pending on future shared library load? (y or [n])
> [answered N; input not from terminal]
> Function "abort" not defined.
> Make breakpoint pending on future shared library load? (y or [n])
> [answered N; input not from terminal]
> (gdb) run
> Starting program: /home/stevenb/devel/build-test/gcc/cc1plus t.C
>  void foo()
> Analyzing compilation unit
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x000000000096b93a in stmts_are_full_exprs_p () at
> ../../trunk/gcc/cp/semantics.c:370
> 370       return current_stmt_tree ()->stmts_are_full_exprs_p;
> (gdb) bt
> #0  0x000000000096b93a in stmts_are_full_exprs_p () at
> ../../trunk/gcc/cp/semantics.c:370
> #1  0x0000000000b1f294 in cp_gimplify_expr (expr_p=0x7ffff7232a20,
> pre_p=0x7fffffff97a8, post_p=0x7fffffff8ba8) at
> ../../trunk/gcc/cp/cp-gimplify.c:530
> #2  0x000000000156fb44 in gimplify_expr (expr_p=0x7ffff7232a20,
> pre_p=0x7fffffff97a8, post_p=0x7fffffff8ba8, gimple_test_f=0x155d16c
> <is_gimple_stmt>, fallback=0)
>     at ../../trunk/gcc/gimplify.c:7064
> #3  0x0000000001563bb7 in gimplify_stmt (stmt_p=0x7ffff7232a20,
> seq_p=0x7fffffff97a8) at ../../trunk/gcc/gimplify.c:5678
> #4  0x0000000001562d43 in gimplify_cleanup_point_expr
> (expr_p=0x7ffff7245ad8, pre_p=0x7fffffffb3b0) at
> ../../trunk/gcc/gimplify.c:5455
> #5  0x0000000001572c33 in gimplify_expr (expr_p=0x7ffff7245ad8,
> pre_p=0x7fffffffb3b0, post_p=0x7fffffff9998, gimple_test_f=0x155d16c
> <is_gimple_stmt>, fallback=0)
>     at ../../trunk/gcc/gimplify.c:7479
> #6  0x0000000001563bb7 in gimplify_stmt (stmt_p=0x7ffff7245ad8,
> seq_p=0x7fffffffb3b0) at ../../trunk/gcc/gimplify.c:5678
> #7  0x0000000001543e69 in gimplify_statement_list
> (expr_p=0x7fffffffb288, pre_p=0x7fffffffb3b0) at
> ../../trunk/gcc/gimplify.c:1527
> #8  0x000000000157352f in gimplify_expr (expr_p=0x7fffffffb288,
> pre_p=0x7fffffffb3b0, post_p=0x7fffffffa6e8, gimple_test_f=0x155d16c
> <is_gimple_stmt>, fallback=0)
>     at ../../trunk/gcc/gimplify.c:7531
> #9  0x0000000001563bb7 in gimplify_stmt (stmt_p=0x7fffffffb288,
> seq_p=0x7fffffffb3b0) at ../../trunk/gcc/gimplify.c:5678
> #10 0x000000000153eb49 in gimplify_and_add (t=0x7ffff7247600,
> seq_p=0x7fffffffb3b0) at ../../trunk/gcc/gimplify.c:358
> #11 0x0000000001572a22 in gimplify_expr (expr_p=0x7ffff7245ac0,
> pre_p=0x7fffffffcd40, post_p=0x7fffffffb3f8, gimple_test_f=0x155d16c
> <is_gimple_stmt>, fallback=0)
>     at ../../trunk/gcc/gimplify.c:7457
> #12 0x0000000001563bb7 in gimplify_stmt (stmt_p=0x7ffff7245ac0,
> seq_p=0x7fffffffcd40) at ../../trunk/gcc/gimplify.c:5678
> #13 0x0000000001543e69 in gimplify_statement_list
> (expr_p=0x7ffff724c098, pre_p=0x7fffffffcd40) at
> ../../trunk/gcc/gimplify.c:1527
> #14 0x000000000157352f in gimplify_expr (expr_p=0x7ffff724c098,
> pre_p=0x7fffffffcd40, post_p=0x7fffffffc148, gimple_test_f=0x155d16c
> <is_gimple_stmt>, fallback=0)
>     at ../../trunk/gcc/gimplify.c:7531
> #15 0x0000000001563bb7 in gimplify_stmt (stmt_p=0x7ffff724c098,
> seq_p=0x7fffffffcd40) at ../../trunk/gcc/gimplify.c:5678
> #16 0x0000000001542106 in gimplify_bind_expr (expr_p=0x7ffff723c898,
> pre_p=0x7fffffffdc80) at ../../trunk/gcc/gimplify.c:1220
> #17 0x0000000001571446 in gimplify_expr (expr_p=0x7ffff723c898,
> pre_p=0x7fffffffdc80, post_p=0x7fffffffd068, gimple_test_f=0x155d16c
> <is_gimple_stmt>, fallback=0)
>     at ../../trunk/gcc/gimplify.c:7316
> #18 0x0000000001563bb7 in gimplify_stmt (stmt_p=0x7ffff723c898,
> seq_p=0x7fffffffdc80) at ../../trunk/gcc/gimplify.c:5678
> #19 0x0000000001577766 in gimplify_body (fndecl=0x7ffff723c800,
> do_parms=1 '\001') at ../../trunk/gcc/gimplify.c:8177
> #20 0x0000000001578d36 in gimplify_function_tree
> (fndecl=0x7ffff723c800) at ../../trunk/gcc/gimplify.c:8311
> #21 0x0000000000fc490c in cgraph_analyze_function
> (node=0x7ffff70d5750) at ../../trunk/gcc/cgraphunit.c:658
> #22 0x0000000000fc5c13 in cgraph_analyze_functions () at
> ../../trunk/gcc/cgraphunit.c:944
> #23 0x0000000000fc9a19 in finalize_compilation_unit () at
> ../../trunk/gcc/cgraphunit.c:2092
> #24 0x0000000000748909 in cp_write_global_declarations () at
> ../../trunk/gcc/cp/decl2.c:4024
> #25 0x0000000001eace3e in compile_file () at ../../trunk/gcc/toplev.c:560
> #26 0x0000000001eaecff in do_compile () at ../../trunk/gcc/toplev.c:1863
> #27 0x0000000001eaee54 in toplev_main (argc=2, argv=0x7fffffffe2b8) at
> ../../trunk/gcc/toplev.c:1939
> #28 0x00000000038889a1 in main (argc=2, argv=0x7fffffffe2b8) at
> ../../trunk/gcc/main.c:36
>
>
>
> Index: final.c
> ===================================================================
> --- final.c     (revision 189459)
> +++ final.c     (working copy)
> @@ -1826,7 +1826,6 @@ void
>  final (rtx first, FILE *file, int optimize_p)
>  {
>    rtx insn, next;
> -  int max_uid = 0;
>    int seen = 0;
>
>    /* Used for -dA dump.  */
> @@ -1837,11 +1836,9 @@ final (rtx first, FILE *file, int optimi
>
>    last_ignored_compare = 0;
>
> +#ifdef HAVE_cc0
>    for (insn = first; insn; insn = NEXT_INSN (insn))
>      {
> -      if (INSN_UID (insn) > max_uid)       /* Find largest UID.  */
> -       max_uid = INSN_UID (insn);
> -#ifdef HAVE_cc0
>        /* If CC tracking across branches is enabled, record the insn which
>          jumps to each branch only reached from one place.  */
>        if (optimize_p && JUMP_P (insn))
> @@ -1852,8 +1849,8 @@ final (rtx first, FILE *file, int optimi
>               LABEL_REFS (lab) = insn;
>             }
>         }
> -#endif
>      }
> +#endif
>
>    init_recog ();
>
> @@ -4500,7 +4497,6 @@ rest_of_clean_state (void)
>    init_recog_no_volatile ();
>
>    /* We're done with this function.  Free up memory if we can.  */
> -  free_after_parsing (cfun);
>    free_after_compilation (cfun);
>    return 0;
>  }
> Index: cgraphunit.c
> ===================================================================
> --- cgraphunit.c        (revision 189459)
> +++ cgraphunit.c        (working copy)
> @@ -404,6 +404,12 @@ cgraph_finalize_function (tree decl, boo
>  {
>    struct cgraph_node *node = cgraph_get_create_node (decl);
>
> +  /* The front end is done with this function.  Free up memory if we can.  */
> +  if (DECL_STRUCT_FUNCTION (decl))
> +    free_after_parsing (DECL_STRUCT_FUNCTION (decl));
> +
> +  /* If this node was finalized before, this must be a re-definition for
> +     an extern inline.  */
>    if (node->local.finalized)
>      {
>        cgraph_reset_node (node);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-16  9:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-11 19:40 [patch] Call free_after_parsing earlier Steven Bosscher
2012-07-12  7:21 ` Richard Guenther
2012-07-13 14:33   ` Steven Bosscher
2012-07-16  9:07     ` 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).