This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Pre-inline optimization, version 3


Hi,
this is slightly improved version of the patch - now when the leak
concncerning SSA names is plugged I can actually ggc_free the SSA names
instead of doing the memset hack.

It would be OK to also just NULLify the pointer to SSA names list now,
but I would actually like to have some mean of checking that the names
are no longer referenced at this place as it is important for whole
consumption (ie if we manage to leak pointer to single name of the list,
we bring alive a lot of other datastructures).  I would be however happy
to skip the ggc_free if it would block the patch and this can be
addressed independencty by Zdenek's verifier or something.

Boostrapped/regtested i686-linux, I also have PPC bootstrap with
--enable-checking=gc,gcac running for three days.  I probably will need
to interrupt it after little extra while, but I hope it is enought of
check that we ought to be quite safe concerning the references to dead
SSA names.

The patch makes following regression to disappear:
gcc.c-torture/execute/pr15262-1.c execution,  -O2                               
gcc.c-torture/execute/pr15262-1.c execution,  -O3 -fomit-frame-pointer          
gcc.c-torture/execute/pr15262-1.c execution,  -O3 -g                            
gcc.c-torture/execute/pr15262-1.c execution,  -Os       
>From nature of the regression I would guess the problem is just made
latent, I will check tomorrow.

:ADDPATCH tree-optimization:
	PR tree-optimization/1046
	* tree-tailcall.c (suitable_for_tail_call_opt_p): Use TREE_ADDRESSABLE
	when alias info is not ready.
	(pass_tail_recursion): Do not require aliasing.
	* tree-ssa-copyrename.c (pass_rename_ssa_cop): Likewise.
	* tree-ssa-ccp.c (pass_ccp, pass_fold_builtins): Likewise.
	* tree-ssa-copy.c (pass_copy_prop): Likewise.
	* tree-ssa-forwprop.c (pass_forwprop): Likewise.
	* tree-ssa-dce.c (pass_dce, pass_dce_loop, pass_cd_dce): Likewise.
	* passes.c (init_optimization_passes): Execute rename_ssa_copies,
	ccp, forwprop, copy_prop, merge_phi, copy_prop, dce and tail recursion
	before inlining.
	* tree-ssa-operands.c (add_virtual_operand, get_indirect_ref_operand):
	When aliasing is not build, mark statement as volatile.

	* gcc.dg/tree-ssa/tailrecursion-4.c: Update dump file.
	* gcc.dg/tree-ssa/tailrecursion-1.c: Update dump file.
	* gcc.dg/tree-ssa/tailrecursion-2.c: Update dump file.
	* gcc.dg/tree-ssa/tailrecursion-3.c: Update dump file.
	* gcc.dg/tree-ssa/pr21658.c: Likewise.
	* gcc.dg/tree-ssa/pr15349.c: Likewise.
	* gcc.dg/tree-ssa/pr25501.c: Likewise.
	* gcc.dg/tree-ssa/vrp11.c: Make more complex so it still test
	transformation in question.
	* gcc.dg/tree-ssa/vrp05.c: Likewise.
	* gcc.dg/tree-ssa/pr20701.c: Likewise.
	* gcc.dg/always_inline3.c: Likewise.
Index: tree-tailcall.c
===================================================================
--- tree-tailcall.c	(revision 120620)
+++ tree-tailcall.c	(working copy)
@@ -143,10 +143,10 @@ suitable_for_tail_opt_p (void)
 
   FOR_EACH_REFERENCED_VAR (var, rvi)
     {
-
       if (!is_global_var (var)
 	  && (!MTAG_P (var) || TREE_CODE (var) == STRUCT_FIELD_TAG)
-	  && is_call_clobbered (var))
+	  && (gimple_aliases_computed_p (cfun) ? is_call_clobbered (var)
+	      : TREE_ADDRESSABLE (var)))
 	return false;
     }
 
@@ -1023,7 +1023,7 @@ struct tree_opt_pass pass_tail_recursion
   NULL,					/* next */
   0,					/* static_pass_number */
   0,					/* tv_id */
-  PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
+  PROP_cfg | PROP_ssa,			/* properties_required */
   0,					/* properties_provided */
   0,					/* properties_destroyed */
   0,					/* todo_flags_start */
Index: tree-pass.h
===================================================================
--- tree-pass.h	(revision 120620)
+++ tree-pass.h	(working copy)
@@ -398,6 +398,7 @@ extern struct tree_opt_pass pass_shorten
 extern struct tree_opt_pass pass_set_nothrow_function_flags;
 extern struct tree_opt_pass pass_final;
 extern struct tree_opt_pass pass_rtl_seqabstr;
+extern struct tree_opt_pass pass_release_ssa_names;
 
 /* The root of the compilation pass tree, once constructed.  */
 extern struct tree_opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes;
Index: testsuite/gcc.dg/tree-ssa/tailrecursion-4.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/tailrecursion-4.c	(revision 120620)
+++ testsuite/gcc.dg/tree-ssa/tailrecursion-4.c	(working copy)
@@ -14,5 +14,5 @@ t(int a)
 		r=r;
 	return r;
 }
-/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 2 "tailr"} } */
-/* { dg-final { cleanup-tree-dump "tailr" } } */
+/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 2 "tailr1"} } */
+/* { dg-final { cleanup-tree-dump "tailr1" } } */
Index: testsuite/gcc.dg/tree-ssa/vrp11.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/vrp11.c	(revision 120620)
+++ testsuite/gcc.dg/tree-ssa/vrp11.c	(working copy)
@@ -1,5 +1,11 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-O2 -fdump-tree-vrp1 -fno-early-inlining" } */
+
+int
+bounce (int arg)
+{
+  return arg;
+}
 
 foo (int k, int j, int z)
 {
@@ -8,12 +14,12 @@ foo (int k, int j, int z)
       if (j > k)
 	{
 	  /* We should fold this to if (1).  */
-	  if (j > z)
+	  if (j > bounce (z))
 	    return j;
 	}
     }
 
-  return j;
+  return j+1;
 }
 
 /* { dg-final { scan-tree-dump-times "Folding predicate.*to 1" 1 "vrp1" } } */
:ADDPATH tree-optimization:
Bootstrapped/regtested i686-linux, OK?
	PR tree-optimization/1046
	* tree-tailcall.c (suitable_for_tail_call_opt_p): Use TREE_ADDRESSABLE
	when alias info is not ready.
	(pass_tail_recursion): Do not require aliasing.
	* tree-ssa-copyrename.c (pass_rename_ssa_cop): Likewise.
	* tree-ssa-ccp.c (pass_ccp, pass_fold_builtins): Likewise.
	* tree-ssa-copy.c (pass_copy_prop): Likewise.
	* tree-ssa-forwprop.c (pass_forwprop): Likewise.
	* tree-ssa-dce.c (pass_dce, pass_dce_loop, pass_cd_dce): Likewise.
	* passes.c (init_optimization_passes): Execute rename_ssa_copies,
	ccp, forwprop, copy_prop, merge_phi, copy_prop, dce and tail recursion
	before inlining.
	* tree-ssa-operands.c (add_virtual_operand, get_indirect_ref_operand):
	When aliasing is not build, mark statement as volatile.

	* gcc.dg/tree-ssa/tailrecursion-4.c: Update dump file.
	* gcc.dg/tree-ssa/tailrecursion-1.c: Update dump file.
	* gcc.dg/tree-ssa/tailrecursion-2.c: Update dump file.
	* gcc.dg/tree-ssa/tailrecursion-3.c: Update dump file.
	* gcc.dg/tree-ssa/pr21658.c: Likewise.
	* gcc.dg/tree-ssa/pr15349.c: Likewise.
	* gcc.dg/tree-ssa/pr25501.c: Likewise.
	* gcc.dg/tree-ssa/vrp11.c: Make more complex so it still test
	transformation in question.
	* gcc.dg/tree-ssa/vrp05.c: Likewise.
	* gcc.dg/tree-ssa/pr20701.c: Likewise.
	* gcc.dg/always_inline3.c: Likewise.
Index: testsuite/gcc.dg/tree-ssa/pr21658.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/pr21658.c	(revision 120620)
+++ testsuite/gcc.dg/tree-ssa/pr21658.c	(working copy)
@@ -17,5 +17,5 @@ f (void)
     link_error ();
 }
 
-/* { dg-final { scan-tree-dump-times "Folded statement: if " 1 "ccp"} } */
-/* { dg-final { cleanup-tree-dump "ccp" } } */
+/* { dg-final { scan-tree-dump-times "Folded statement: if " 1 "ccp1"} } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
Index: testsuite/gcc.dg/tree-ssa/vrp05.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/vrp05.c	(revision 120620)
+++ testsuite/gcc.dg/tree-ssa/vrp05.c	(working copy)
@@ -1,19 +1,29 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-O2 -fdump-tree-vrp1 -fno-early-inlining" } */
+
+
+inline int ten()
+{
+  return 10;
+}
+inline int zero()
+{
+  return 0;
+}
 
 foo (int k, int j)
 {
-  if (k >= 10)
+  if (k >= ten())
     {
       if (j > k)
 	{
 	  /* We should fold this to if (1).  */
-	  if (j > 0)
+	  if (j > zero())
 	    return j;
 	}
     }
 
-  return j;
+  return j+1;
 }
 
 /* { dg-final { scan-tree-dump-times "Folding predicate j_.*to 1" 1 "vrp1" } } */
Index: testsuite/gcc.dg/tree-ssa/pr15349.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/pr15349.c	(revision 120620)
+++ testsuite/gcc.dg/tree-ssa/pr15349.c	(working copy)
@@ -22,5 +22,5 @@ foo (int a, int b)
   return t;
 }
 
-/* { dg-final { scan-tree-dump-times "PHI" 1 "mergephi"} } */
-/* { dg-final { cleanup-tree-dump "mergephi" } } */
+/* { dg-final { scan-tree-dump-times "PHI" 1 "mergephi2"} } */
+/* { dg-final { cleanup-tree-dump "mergephi2" } } */
Index: testsuite/gcc.dg/tree-ssa/pr20701.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/pr20701.c	(revision 120620)
+++ testsuite/gcc.dg/tree-ssa/pr20701.c	(working copy)
@@ -1,30 +1,39 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-O2 -fdump-tree-vrp2 -fno-early-inlining" } */
 
 typedef struct {
   int code;
 } *rtx;
 
+static inline void *zero ()
+{
+  return 0;
+}
+static inline int three ()
+{
+  return 3;
+}
+
 int
 can_combine_p (rtx insn, rtx elt)
 {
   rtx set;
 
-  set = 0;
-  if (insn->code == 3)
+  set = zero ();
+  if (insn->code == three ())
     set = insn;
   else
     {
       set = elt;
-      if (set == 0)
+      if (set == zero ())
 	return 0;
     }
 
-  if (set == 0)
+  if (set == zero ())
     return 1;
 
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp1" } } */
-/* { dg-final { cleanup-tree-dump "vrp1" } } */
+/* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp2" } } */
+/* { dg-final { cleanup-tree-dump "vrp2" } } */
Index: testsuite/gcc.dg/tree-ssa/pr25501.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/pr25501.c	(revision 120620)
+++ testsuite/gcc.dg/tree-ssa/pr25501.c	(working copy)
@@ -32,5 +32,5 @@ foo (int a)
   return 13;
 }
 
-/* { dg-final { scan-tree-dump-times "Removing basic block" 0 "mergephi"} } */
+/* { dg-final { scan-tree-dump-times "Removing basic block" 0 "mergephi1"} } */
 /* { dg-final { cleanup-tree-dump "mergephi" } } */
Index: testsuite/gcc.dg/tree-ssa/tailrecursion-1.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/tailrecursion-1.c	(revision 120620)
+++ testsuite/gcc.dg/tree-ssa/tailrecursion-1.c	(working copy)
@@ -8,5 +8,5 @@ t(int a)
 	else
 		return 0;
 }
-/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr"} } */
-/* { dg-final { cleanup-tree-dump "tailr" } } */
+/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr1"} } */
+/* { dg-final { cleanup-tree-dump "tailr1" } } */
Index: testsuite/gcc.dg/tree-ssa/tailrecursion-2.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/tailrecursion-2.c	(revision 120620)
+++ testsuite/gcc.dg/tree-ssa/tailrecursion-2.c	(working copy)
@@ -9,5 +9,5 @@ t(char *a)
 	else
 		return 0;
 }
-/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr"} } */
-/* { dg-final { cleanup-tree-dump "tailr" } } */
+/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr1"} } */
+/* { dg-final { cleanup-tree-dump "tailr1" } } */
Index: testsuite/gcc.dg/tree-ssa/tailrecursion-3.c
===================================================================
--- testsuite/gcc.dg/tree-ssa/tailrecursion-3.c	(revision 120620)
+++ testsuite/gcc.dg/tree-ssa/tailrecursion-3.c	(working copy)
@@ -12,5 +12,5 @@ t(int a)
 		r=r;
 	return r;
 }
-/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr"} } */
-/* { dg-final { cleanup-tree-dump "tailr" } } */
+/* { dg-final { scan-tree-dump-times "Eliminated tail recursion" 1 "tailr1"} } */
+/* { dg-final { cleanup-tree-dump "tailr1" } } */
Index: testsuite/gcc.dg/always_inline3.c
===================================================================
--- testsuite/gcc.dg/always_inline3.c	(revision 120620)
+++ testsuite/gcc.dg/always_inline3.c	(working copy)
@@ -1,8 +1,10 @@
 /* { dg-do compile } */
 /* { dg-options "-Winline -O2" } */
+void do_something_evil (void);
 inline __attribute__ ((always_inline)) void
 q2(void)
 { 				/* { dg-error "recursive" "" } */
+  do_something_evil ();
   q2(); 			/* { dg-error "called from here" "" } */
   q2(); 			/* { dg-error "called from here" "" } */
 }
Index: tree-ssa-copyrename.c
===================================================================
--- tree-ssa-copyrename.c	(revision 120620)
+++ tree-ssa-copyrename.c	(working copy)
@@ -394,7 +394,7 @@ struct tree_opt_pass pass_rename_ssa_cop
   NULL,					/* next */
   0,					/* static_pass_number */
   TV_TREE_COPY_RENAME,			/* tv_id */
-  PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
+  PROP_cfg | PROP_ssa,			/* properties_required */
   0,					/* properties_provided */
   0,					/* properties_destroyed */
   0,					/* todo_flags_start */ 
Index: tree-ssa-ccp.c
===================================================================
--- tree-ssa-ccp.c	(revision 120620)
+++ tree-ssa-ccp.c	(working copy)
@@ -1431,7 +1431,7 @@ struct tree_opt_pass pass_ccp = 
   NULL,					/* next */
   0,					/* static_pass_number */
   TV_TREE_CCP,				/* tv_id */
-  PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
+  PROP_cfg | PROP_ssa,			/* properties_required */
   0,					/* properties_provided */
   0,					/* properties_destroyed */
   0,					/* todo_flags_start */
@@ -2650,7 +2650,7 @@ struct tree_opt_pass pass_fold_builtins 
   NULL,					/* next */
   0,					/* static_pass_number */
   0,					/* tv_id */
-  PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
+  PROP_cfg | PROP_ssa,			/* properties_required */
   0,					/* properties_provided */
   0,					/* properties_destroyed */
   0,					/* todo_flags_start */
Index: tree-ssa-copy.c
===================================================================
--- tree-ssa-copy.c	(revision 120620)
+++ tree-ssa-copy.c	(working copy)
@@ -1137,7 +1137,7 @@ struct tree_opt_pass pass_copy_prop =
   NULL,					/* next */
   0,					/* static_pass_number */
   TV_TREE_COPY_PROP,			/* tv_id */
-  PROP_ssa | PROP_alias | PROP_cfg,	/* properties_required */
+  PROP_ssa | PROP_cfg,			/* properties_required */
   0,					/* properties_provided */
   0,					/* properties_destroyed */
   0,					/* todo_flags_start */
Index: tree-ssa-forwprop.c
===================================================================
--- tree-ssa-forwprop.c	(revision 120620)
+++ tree-ssa-forwprop.c	(working copy)
@@ -1060,8 +1060,7 @@ struct tree_opt_pass pass_forwprop = {
   NULL,				/* next */
   0,				/* static_pass_number */
   TV_TREE_FORWPROP,		/* tv_id */
-  PROP_cfg | PROP_ssa
-    | PROP_alias,		/* properties_required */
+  PROP_cfg | PROP_ssa,		/* properties_required */
   0,				/* properties_provided */
   0,				/* properties_destroyed */
   0,				/* todo_flags_start */
Index: tree-ssa-dce.c
===================================================================
--- tree-ssa-dce.c	(revision 120620)
+++ tree-ssa-dce.c	(working copy)
@@ -859,7 +859,7 @@ struct tree_opt_pass pass_dce =
   NULL,					/* next */
   0,					/* static_pass_number */
   TV_TREE_DCE,				/* tv_id */
-  PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
+  PROP_cfg | PROP_ssa,			/* properties_required */
   0,					/* properties_provided */
   0,					/* properties_destroyed */
   0,					/* todo_flags_start */
@@ -881,7 +881,7 @@ struct tree_opt_pass pass_dce_loop =
   NULL,					/* next */
   0,					/* static_pass_number */
   TV_TREE_DCE,				/* tv_id */
-  PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
+  PROP_cfg | PROP_ssa,			/* properties_required */
   0,					/* properties_provided */
   0,					/* properties_destroyed */
   0,					/* todo_flags_start */
@@ -901,7 +901,7 @@ struct tree_opt_pass pass_cd_dce =
   NULL,					/* next */
   0,					/* static_pass_number */
   TV_TREE_CD_DCE,			/* tv_id */
-  PROP_cfg | PROP_ssa | PROP_alias,	/* properties_required */
+  PROP_cfg | PROP_ssa,			/* properties_required */
   0,					/* properties_provided */
   0,					/* properties_destroyed */
   0,					/* todo_flags_start */
Index: passes.c
===================================================================
--- passes.c	(revision 120620)
+++ passes.c	(working copy)
@@ -481,6 +481,15 @@ init_optimization_passes (void)
   NEXT_PASS (pass_build_ssa);
   NEXT_PASS (pass_early_warn_uninitialized);
   NEXT_PASS (pass_cleanup_cfg);
+  NEXT_PASS (pass_rename_ssa_copies);
+  NEXT_PASS (pass_ccp);
+  
+  NEXT_PASS (pass_forwprop);
+  NEXT_PASS (pass_copy_prop);
+  NEXT_PASS (pass_merge_phi);
+  NEXT_PASS (pass_dce);
+  NEXT_PASS (pass_tail_recursion);
+  NEXT_PASS (pass_release_ssa_names);
 
   *p = NULL;
 
@@ -1003,6 +1012,11 @@ execute_ipa_pass_list (struct tree_opt_p
     {
       gcc_assert (!current_function_decl);
       gcc_assert (!cfun);
+      if (!quiet_flag)
+	{
+          fprintf (stderr, " <%s>", pass->name ? pass->name : "");
+	  fflush (stderr);
+	}
       if (execute_one_pass (pass) && pass->sub)
 	do_per_function ((void (*)(void *))execute_pass_list, pass->sub);
       if (!current_function_decl)
Index: tree-ssanames.c
===================================================================
--- tree-ssanames.c	(revision 120620)
+++ tree-ssanames.c	(working copy)
@@ -26,6 +26,7 @@ Boston, MA 02110-1301, USA.  */
 #include "varray.h"
 #include "ggc.h"
 #include "tree-flow.h"
+#include "tree-pass.h"
 
 /* Rewriting a function into SSA form can create a huge number of SSA_NAMEs,
    many of which may be thrown away shortly after their creation if jumps
@@ -304,3 +305,48 @@ replace_ssa_name_symbol (tree ssa_name, 
   SSA_NAME_VAR (ssa_name) = sym;
   TREE_TYPE (ssa_name) = TREE_TYPE (sym);
 }
+
+/* Return SSA names that are unused to GGC memory.  This is used to keep
+   footprint of compiler during interprocedural optimization.
+   As a side effect the SSA_NAME_VERSION number reuse is reduced
+   so this function should not be used too often.  */
+static unsigned int
+release_dead_ssa_names (void)
+{
+  tree t, next;
+  int n = 0;
+  referenced_var_iterator rvi;
+
+  /* Current defs point to various dead SSA names that in turn points to dead
+     statements so bunch of dead memory is holded from releasing.  */
+  FOR_EACH_REFERENCED_VAR (t, rvi)
+    set_current_def (t, NULL);
+  /* Now release the freelist.  */
+  for (t = FREE_SSANAMES (cfun); t; t = next)
+    {
+      next = TREE_CHAIN (t);
+      ggc_free (t);
+      n++;
+    }
+  FREE_SSANAMES (cfun) = NULL;
+  if (dump_file)
+    fprintf (dump_file, "Released %i names, %.2f%%\n", n, n * 100.0 / num_ssa_names);
+  return 0;
+}
+
+struct tree_opt_pass pass_release_ssa_names =
+{
+  "release_ssa",			/* name */
+  NULL,					/* gate */
+  release_dead_ssa_names,		/* execute */
+  NULL,					/* sub */
+  NULL,					/* next */
+  0,					/* static_pass_number */
+  0,					/* tv_id */
+  PROP_ssa,				/* properties_required */
+  0,					/* properties_provided */
+  0,					/* properties_destroyed */
+  0,					/* todo_flags_start */
+  0,					/* todo_flags_finish */
+  0					/* letter */
+};
Index: tree-ssa-operands.c
===================================================================
--- tree-ssa-operands.c	(revision 120620)
+++ tree-ssa-operands.c	(working copy)
@@ -1480,6 +1480,8 @@ add_virtual_operand (tree var, stmt_ann_
   aliases = v_ann->may_aliases;
   if (aliases == NULL)
     {
+      if (s_ann && !gimple_aliases_computed_p (cfun))
+        s_ann->has_volatile_ops = true;
       /* The variable is not aliased or it is an alias tag.  */
       if (flags & opf_def)
 	append_vdef (var);
@@ -1610,6 +1612,8 @@ get_indirect_ref_operands (tree stmt, tr
   stmt_ann_t s_ann = stmt_ann (stmt);
 
   s_ann->references_memory = true;
+  if (s_ann && TREE_THIS_VOLATILE (expr))
+    s_ann->has_volatile_ops = true; 
 
   if (SSA_VAR_P (ptr))
     {
@@ -1652,6 +1656,11 @@ get_indirect_ref_operands (tree stmt, tr
 	  if (v_ann->symbol_mem_tag)
 	    add_virtual_operand (v_ann->symbol_mem_tag, s_ann, flags,
 				 full_ref, offset, size, false);
+          /* Aliasing information is missing; mark statement as volatile so we
+             won't optimize it out too actively.  */
+          else if (s_ann && !gimple_aliases_computed_p (cfun)
+                   && (flags & opf_def))
+            s_ann->has_volatile_ops = true;
 	}
     }
   else if (TREE_CODE (ptr) == INTEGER_CST)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]