aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-coalesce.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-10-08 21:13:52 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-10-08 21:13:52 +0000
commit561593c104a3fcce354d644b12072b1da8690baa (patch)
tree149b1fac42bf695760c221ab62b82c4d671b93af /gcc/tree-ssa-coalesce.c
parentcaeaa0b3c63bc2634f7ae8f684224b2773c782c1 (diff)
downloadgcc-561593c104a3fcce354d644b12072b1da8690baa.zip
gcc-561593c104a3fcce354d644b12072b1da8690baa.tar.gz
gcc-561593c104a3fcce354d644b12072b1da8690baa.tar.bz2
tree-outof-ssa.h (ssaexpand): Add partitions_for_undefined_values.
* tree-outof-ssa.h (ssaexpand): Add partitions_for_undefined_values. (always_initialized_rtx_for_ssa_name_p): New predicate. * tree-outof-ssa.c (remove_ssa_form): Initialize new field of SA. (finish_out_of_ssa): Free new field of SA. * tree-ssa-coalesce.h (get_undefined_value_partitions): Declare. * tree-ssa-coalesce.c: Include tree-ssa.h. (get_parm_default_def_partitions): Remove extern keyword. (get_undefined_value_partitions): New function. * expr.c (expand_expr_real_1) <expand_decl_rtl>: For a SSA_NAME, do not set SUBREG_PROMOTED_VAR_P on the sub-register if it may contain uninitialized bits. * loop-iv.c (iv_get_reaching_def): Disqualify all subregs. From-SVN: r253530
Diffstat (limited to 'gcc/tree-ssa-coalesce.c')
-rw-r--r--gcc/tree-ssa-coalesce.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c
index e166314..3938f06 100644
--- a/gcc/tree-ssa-coalesce.c
+++ b/gcc/tree-ssa-coalesce.c
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "memmodel.h"
#include "tm_p.h"
#include "ssa.h"
+#include "tree-ssa.h"
#include "tree-pretty-print.h"
#include "diagnostic-core.h"
#include "dumpfile.h"
@@ -1923,7 +1924,7 @@ set_parm_default_def_partition (tree var, void *arg_)
/* Allocate and return a bitmap that has a bit set for each partition
that contains a default def for a parameter. */
-extern bitmap
+bitmap
get_parm_default_def_partitions (var_map map)
{
bitmap parm_default_def_parts = BITMAP_ALLOC (NULL);
@@ -1935,3 +1936,28 @@ get_parm_default_def_partitions (var_map map)
return parm_default_def_parts;
}
+
+/* Allocate and return a bitmap that has a bit set for each partition
+ that contains an undefined value. */
+
+bitmap
+get_undefined_value_partitions (var_map map)
+{
+ bitmap undefined_value_parts = BITMAP_ALLOC (NULL);
+
+ for (unsigned int i = 1; i < num_ssa_names; i++)
+ {
+ tree var = ssa_name (i);
+ if (var
+ && !virtual_operand_p (var)
+ && !has_zero_uses (var)
+ && ssa_undefined_value_p (var))
+ {
+ const int p = var_to_partition (map, var);
+ if (p != NO_PARTITION)
+ bitmap_set_bit (undefined_value_parts, p);
+ }
+ }
+
+ return undefined_value_parts;
+}