]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cgraph.c (cgraph_create_edge, [...]): Set proper cfun.
authorJan Hubicka <jh@suse.cz>
Sun, 19 Apr 2009 13:27:28 +0000 (15:27 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 19 Apr 2009 13:27:28 +0000 (13:27 +0000)
* cgraph.c (cgraph_create_edge, cgraph_set_call_stmt): Set proper cfun.
(dump_cgraph_node): Dump can throw external flag.
* ipa-pure-const.c (propagate): Fix propagation of nothrow flags.

From-SVN: r146349

gcc/ChangeLog
gcc/cgraph.c
gcc/ipa-pure-const.c

index 09f17e570e3e75ae1659b51370e26bcfe8fe0bf6..1343784fde1c2f7f9e1d805ffd1fc182eea6438c 100644 (file)
@@ -1,3 +1,9 @@
+2009-04-19  Jan Hubicka  <jh@suse.cz>
+
+       * cgraph.c (cgraph_create_edge, cgraph_set_call_stmt): Set proper cfun.
+       (dump_cgraph_node): Dump can throw external flag.
+       * ipa-pure-const.c (propagate): Fix propagation of nothrow flags.
+
 2009-04-19  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        PR c/32061
index f7189b92ecaed6cce53698a7d8e451be1148e3fb..ce696e211b65ad9387ad314307ce74cbef0913fd 100644 (file)
@@ -640,7 +640,9 @@ cgraph_set_call_stmt (struct cgraph_edge *e, gimple new_stmt)
                                 htab_hash_pointer (e->call_stmt));
     }
   e->call_stmt = new_stmt;
+  push_cfun (DECL_STRUCT_FUNCTION (e->caller->decl));
   e->can_throw_external = stmt_can_throw_external (new_stmt);
+  pop_cfun ();
   if (e->caller->call_site_hash)
     {
       void **slot;
@@ -705,7 +707,9 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
   edge->caller = caller;
   edge->callee = callee;
   edge->call_stmt = call_stmt;
+  push_cfun (DECL_STRUCT_FUNCTION (caller->decl));
   edge->can_throw_external = stmt_can_throw_external (call_stmt);
+  pop_cfun ();
   edge->prev_caller = NULL;
   edge->next_caller = callee->callers;
   if (callee->callers)
@@ -1238,6 +1242,8 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node)
                 edge->frequency / (double)CGRAPH_FREQ_BASE);
       if (edge->loop_nest)
        fprintf (f, "(nested in %i loops) ", edge->loop_nest);
+      if (edge->can_throw_external)
+       fprintf(f, "(can throw external) ");
     }
   fprintf (f, "\n");
 }
index 1aef09f5221ebd250241f0073cf37ed7f8f28a2c..c938b0da1c6af55f17f5db874a96dc004ddadc06 100644 (file)
@@ -830,6 +830,7 @@ propagate (void)
       w = node;
       while (w)
        {
+         funct_state w_l = get_function_state (w);
          if (!can_throw && !TREE_NOTHROW (w->decl))
            {
              struct cgraph_edge *e;
@@ -840,6 +841,8 @@ propagate (void)
                fprintf (dump_file, "Function found to be nothrow: %s\n",  
                         cgraph_node_name (w));
            }
+         else if (can_throw && !TREE_NOTHROW (w->decl))
+           w_l->can_throw = true;
          w_info = (struct ipa_dfs_info *) w->aux;
          w = w_info->next_cycle;
        }