From 38154e4f0f18baf7e80c1b78e25ac305c922a268 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Wed, 28 May 2008 14:45:57 +0000 Subject: [PATCH] re PR tree-optimization/36339 (not call clobbering variable for non common offset) 2008-05-28 Richard Guenther PR tree-optimization/36339 * tree-ssa-alias.c (set_initial_properties): Move pt_anything and clobbering code out of the loop. From-SVN: r136100 --- gcc/ChangeLog | 6 ++++++ gcc/tree-ssa-alias.c | 32 +++++++++++++++++++------------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a64b0b01185..43e61a636b0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-05-28 Richard Guenther + + PR tree-optimization/36339 + * tree-ssa-alias.c (set_initial_properties): Move pt_anything + and clobbering code out of the loop. + 2008-05-28 Andreas Krebbel * config/s390/constraints.md ('b', 'C', 'D', 'e'): New constraint diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 983e321521d..4f661543a55 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -521,6 +521,8 @@ set_initial_properties (struct alias_info *ai) referenced_var_iterator rvi; tree var; tree ptr; + bool any_pt_anything = false; + enum escape_type pt_anything_mask = 0; FOR_EACH_REFERENCED_VAR (var, rvi) { @@ -573,19 +575,8 @@ set_initial_properties (struct alias_info *ai) } else if (pi->pt_anything) { - bitmap_iterator bi; - unsigned int j; - - /* If we do not have the points-to set filled out we - still need to honor that this escaped pointer points - to anything. */ - EXECUTE_IF_SET_IN_BITMAP (gimple_addressable_vars (cfun), - 0, j, bi) - { - tree var = referenced_var (j); - if (!unmodifiable_var_p (var)) - mark_call_clobbered (var, pi->escape_mask); - } + any_pt_anything = true; + pt_anything_mask |= pi->escape_mask; } } @@ -619,6 +610,21 @@ set_initial_properties (struct alias_info *ai) MTAG_GLOBAL (tag) = true; } } + + /* If a pt_anything pointer escaped we need to mark all addressable + variables call clobbered. */ + if (any_pt_anything) + { + bitmap_iterator bi; + unsigned int j; + + EXECUTE_IF_SET_IN_BITMAP (gimple_addressable_vars (cfun), 0, j, bi) + { + tree var = referenced_var (j); + if (!unmodifiable_var_p (var)) + mark_call_clobbered (var, pt_anything_mask); + } + } } /* Compute which variables need to be marked call clobbered because -- 2.30.2