aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.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/expr.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/expr.c')
-rw-r--r--gcc/expr.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 2f8432d..134ee73 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -9909,24 +9909,43 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
&& GET_MODE (decl_rtl) != dmode)
{
machine_mode pmode;
+ bool always_initialized_rtx;
/* Get the signedness to be used for this variable. Ensure we get
the same mode we got when the variable was declared. */
if (code != SSA_NAME)
- pmode = promote_decl_mode (exp, &unsignedp);
+ {
+ pmode = promote_decl_mode (exp, &unsignedp);
+ always_initialized_rtx = true;
+ }
else if ((g = SSA_NAME_DEF_STMT (ssa_name))
&& gimple_code (g) == GIMPLE_CALL
&& !gimple_call_internal_p (g))
- pmode = promote_function_mode (type, mode, &unsignedp,
- gimple_call_fntype (g),
- 2);
+ {
+ pmode = promote_function_mode (type, mode, &unsignedp,
+ gimple_call_fntype (g), 2);
+ always_initialized_rtx
+ = always_initialized_rtx_for_ssa_name_p (ssa_name);
+ }
else
- pmode = promote_ssa_mode (ssa_name, &unsignedp);
+ {
+ pmode = promote_ssa_mode (ssa_name, &unsignedp);
+ always_initialized_rtx
+ = always_initialized_rtx_for_ssa_name_p (ssa_name);
+ }
+
gcc_assert (GET_MODE (decl_rtl) == pmode);
temp = gen_lowpart_SUBREG (mode, decl_rtl);
- SUBREG_PROMOTED_VAR_P (temp) = 1;
- SUBREG_PROMOTED_SET (temp, unsignedp);
+
+ /* We cannot assume anything about an existing extension if the
+ register may contain uninitialized bits. */
+ if (always_initialized_rtx)
+ {
+ SUBREG_PROMOTED_VAR_P (temp) = 1;
+ SUBREG_PROMOTED_SET (temp, unsignedp);
+ }
+
return temp;
}