aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-live.c
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2014-11-03 11:47:04 +0100
committerMarc Glisse <glisse@gcc.gnu.org>2014-11-03 10:47:04 +0000
commit956623c1378de3c48e77b23c2f2fa275f183e270 (patch)
treeb8fffd826c781877806bce6555060851ee0637bd /gcc/tree-ssa-live.c
parentb25b35c4ca7edf62118660048d5a7672653644f4 (diff)
downloadgcc-956623c1378de3c48e77b23c2f2fa275f183e270.zip
gcc-956623c1378de3c48e77b23c2f2fa275f183e270.tar.gz
gcc-956623c1378de3c48e77b23c2f2fa275f183e270.tar.bz2
re PR tree-optimization/60770 (disappearing clobbers)
2014-11-03 Marc Glisse <marc.glisse@inria.fr> PR tree-optimization/60770 gcc/ * tree-into-ssa.c (rewrite_update_stmt): Return whether the statement should be removed. (maybe_register_def): Likewise. Replace clobbers with default definitions. (rewrite_dom_walker::before_dom_children): Remove statement if rewrite_update_stmt says so. * tree-ssa-live.c: Include tree-ssa.h. (set_var_live_on_entry): Do not mark undefined variables as live. (verify_live_on_entry): Do not check undefined variables. * tree-ssa.h (ssa_undefined_value_p): New parameter for the case of partially undefined variables. * tree-ssa.c (ssa_undefined_value_p): Likewise. (execute_update_addresses_taken): Do not drop clobbers. gcc/testsuite/ * gcc.dg/tree-ssa/pr60770-1.c: New file. From-SVN: r217034
Diffstat (limited to 'gcc/tree-ssa-live.c')
-rw-r--r--gcc/tree-ssa-live.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 1effb43..22013e0 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -57,6 +57,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-core.h"
#include "debug.h"
#include "flags.h"
+#include "tree-ssa.h"
#ifdef ENABLE_CHECKING
static void verify_live_on_entry (tree_live_info_p);
@@ -1103,6 +1104,10 @@ set_var_live_on_entry (tree ssa_name, tree_live_info_p live)
else
def_bb = ENTRY_BLOCK_PTR_FOR_FN (cfun);
+ /* An undefined local variable does not need to be very alive. */
+ if (ssa_undefined_value_p (ssa_name, false))
+ return;
+
/* Visit each use of SSA_NAME and if it isn't in the same block as the def,
add it to the list of live on entry blocks. */
FOR_EACH_IMM_USE_FAST (use, imm_iter, ssa_name)
@@ -1439,6 +1444,11 @@ verify_live_on_entry (tree_live_info_p live)
else
if (d == var)
{
+ /* An undefined local variable does not need to be very
+ alive. */
+ if (ssa_undefined_value_p (var, false))
+ continue;
+
/* The only way this var shouldn't be marked live on entry is
if it occurs in a PHI argument of the block. */
size_t z;