aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2004-07-28 17:57:27 +0000
committerDiego Novillo <dnovillo@gcc.gnu.org>2004-07-28 13:57:27 -0400
commite0d3bb46f199dd0129bbe0df48cf6981610dbcef (patch)
tree62decfb4fb7049220455e8e34566da59c3049bc2
parent852c7b12c56a25dfbad50418d9c4a093b7463bd4 (diff)
downloadgcc-e0d3bb46f199dd0129bbe0df48cf6981610dbcef.zip
gcc-e0d3bb46f199dd0129bbe0df48cf6981610dbcef.tar.gz
gcc-e0d3bb46f199dd0129bbe0df48cf6981610dbcef.tar.bz2
tree-ssa-alias.c (maybe_create_global_var): Don't just return if .GLOBAL_VAR has been created.
* tree-ssa-alias.c (maybe_create_global_var): Don't just return if .GLOBAL_VAR has been created. From-SVN: r85268
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-ssa-alias.c39
2 files changed, 25 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 259ad7c..7341996 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2004-07-28 Diego Novillo <dnovillo@redhat.com>
+ * tree-ssa-alias.c (maybe_create_global_var): Don't just
+ return if .GLOBAL_VAR has been created.
+
+2004-07-28 Diego Novillo <dnovillo@redhat.com>
+
* tree-ssa.c (verify_flow_insensitive_alias_info): Process
every variable that may have aliases, not just tags.
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 94ccd80..7ad1867 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -1492,33 +1492,34 @@ maybe_create_global_var (struct alias_info *ai)
size_t i, n_clobbered;
/* No need to create it, if we have one already. */
- if (global_var)
- return;
-
- /* Count all the call-clobbered variables. */
- n_clobbered = 0;
- EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, n_clobbered++);
+ if (global_var == NULL_TREE)
+ {
+ /* Count all the call-clobbered variables. */
+ n_clobbered = 0;
+ EXECUTE_IF_SET_IN_BITMAP (call_clobbered_vars, 0, i, n_clobbered++);
- /* Create .GLOBAL_VAR if we have too many call-clobbered variables.
- We also create .GLOBAL_VAR when there no call-clobbered variables
- to prevent code motion transformations from re-arranging function
- calls that may have side effects. For instance,
+ /* Create .GLOBAL_VAR if we have too many call-clobbered
+ variables. We also create .GLOBAL_VAR when there no
+ call-clobbered variables to prevent code motion
+ transformations from re-arranging function calls that may
+ have side effects. For instance,
- foo ()
+ foo ()
{
int a = f ();
g ();
h (a);
}
- There are no call-clobbered variables in foo(), so it would be
- entirely possible for a pass to want to move the call to f()
- after the call to g(). If f() has side effects, that would be
- wrong. Creating .GLOBAL_VAR in this case will insert VDEFs for
- it and prevent such transformations. */
- if (n_clobbered == 0
- || ai->num_calls_found * n_clobbered >= (size_t) GLOBAL_VAR_THRESHOLD)
- create_global_var ();
+ There are no call-clobbered variables in foo(), so it would
+ be entirely possible for a pass to want to move the call to
+ f() after the call to g(). If f() has side effects, that
+ would be wrong. Creating .GLOBAL_VAR in this case will
+ insert VDEFs for it and prevent such transformations. */
+ if (n_clobbered == 0
+ || ai->num_calls_found * n_clobbered >= (size_t) GLOBAL_VAR_THRESHOLD)
+ create_global_var ();
+ }
/* If the function has calls to clobbering functions and .GLOBAL_VAR has
been created, make it an alias for all call-clobbered variables. */