OSDN Git Service

* passes.c (rest_of_handle_cfg): Disable const/pure function
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 25 Sep 2004 10:05:09 +0000 (10:05 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 25 Sep 2004 10:05:09 +0000 (10:05 +0000)
detection when doing tree based profiling.

* tree-inline.c (expand_call_inline): Fix incorrectly reversed
conditional.

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

gcc/ChangeLog
gcc/passes.c
gcc/tree-inline.c

index bcfe591..db70344 100644 (file)
@@ -1,3 +1,11 @@
+2004-09-25  Jan Hubicka  <jh@suse.cz>
+
+       * passes.c (rest_of_handle_cfg): Disable const/pure function
+       detection when doing tree based profiling.
+
+       * tree-inline.c (expand_call_inline): Fix incorrectly reversed
+       conditional.
+
 2004-09-25  Richard Sandiford  <rsandifo@redhat.com>
 
        * config/mips/mips.h (struct mips_args): Clarify comments.
index c62f2e9..5488981 100644 (file)
@@ -880,8 +880,15 @@ rest_of_handle_cfg (void)
      it as constant, otherwise -fbranch-probabilities will not read data back.
 
      life_analysis rarely eliminates modification of external memory.
-   */
-  if (optimize)
+
+     FIXME: now with tree based profiling we are in the trap described above
+     again.  It seems to be easiest to disable the optimization for time
+     being before the problem is either solved by moving the transformation
+     to the IPA level (we need the CFG for this) or the very early optimization
+     passes are made to ignore the const/pure flags so code does not change.  */
+  if (optimize
+      && (!flag_tree_based_profiling
+         || (!profile_arc_flag && !flag_branch_probabilities)))
     {
       /* Alias analysis depends on this information and mark_constant_function
        depends on alias analysis.  */
index d026dca..38fa455 100644 (file)
@@ -1458,7 +1458,7 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data)
          where previous inlining turned indirect call into direct call by
          constant propagating arguments.  In all other cases we hit a bug
          (incorrect node sharing is most common reason for missing edges.  */
-      gcc_assert (dest->needed || flag_unit_at_a_time);
+      gcc_assert (dest->needed || !flag_unit_at_a_time);
       cgraph_create_edge (id->node, dest, t)->inline_failed
        = N_("originally indirect function call not considered for inlining");
       goto egress;