diff options
author | Eric Botcazou <ebotcazou@libertysurf.fr> | 2007-12-13 22:49:09 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2007-12-13 21:49:09 +0000 |
commit | 7b7e6ecdb03f08b99c4738473482b4f749af1de0 (patch) | |
tree | 1a2db453ef003669b76c5fe7b06ef0c746c75775 /gcc/tree-ssa.c | |
parent | e49f4f07da9c797eb0efadb36161b36cdc7fef47 (diff) | |
download | gcc-7b7e6ecdb03f08b99c4738473482b4f749af1de0.tar.gz |
re PR middle-end/33088 (spurious exceptions with -ffloat-store)
PR middle-end/33088
* gimplify.c (gimplify_modify_expr_complex_part): Add note to comment.
* tree-complex.c (init_dont_simulate_again): Return true if there are
uninitialized loads generated by gimplify_modify_expr_complex_part.
* tree-gimple.c (is_gimple_reg_type): Return false for complex types
if not optimizing.
* tree-ssa.c (ssa_undefined_value_p): New predicate extracted from...
(warn_uninit): ...here. Use ssa_undefined_value_p.
* tree-ssa-pre.c (is_undefined_value): Delete.
(phi_translate_1): Use ssa_undefined_value_p.
(add_to_exp_gen): Likewise.
(make_values_for_stmt): Likewise.
* tree-flow.h (ssa_undefined_value_p): Declare.
From-SVN: r130917
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index eeb76806f8d..6c06df094b1 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -1228,9 +1228,28 @@ walk_use_def_chains (tree var, walk_use_def_chains_fn fn, void *data, } +/* Return true if T, an SSA_NAME, has an undefined value. */ + +bool +ssa_undefined_value_p (tree t) +{ + tree var = SSA_NAME_VAR (t); + + /* Parameters get their initial value from the function entry. */ + if (TREE_CODE (var) == PARM_DECL) + return false; + + /* Hard register variables get their initial value from the ether. */ + if (TREE_CODE (var) == VAR_DECL && DECL_HARD_REGISTER (var)) + return false; + + /* The value is undefined iff its definition statement is empty. */ + return IS_EMPTY_STMT (SSA_NAME_DEF_STMT (t)); +} + /* Emit warnings for uninitialized variables. This is done in two passes. - The first pass notices real uses of SSA names with default definitions. + The first pass notices real uses of SSA names with undefined values. Such uses are unconditionally uninitialized, and we can be certain that such a use is a mistake. This pass is run before most optimizations, so that we catch as many as we can. @@ -1250,22 +1269,11 @@ static void warn_uninit (tree t, const char *gmsgid, void *data) { tree var = SSA_NAME_VAR (t); - tree def = SSA_NAME_DEF_STMT (t); tree context = (tree) data; location_t *locus; expanded_location xloc, floc; - /* Default uses (indicated by an empty definition statement), - are uninitialized. */ - if (!IS_EMPTY_STMT (def)) - return; - - /* Except for PARMs of course, which are always initialized. */ - if (TREE_CODE (var) == PARM_DECL) - return; - - /* Hard register variables get their initial value from the ether. */ - if (TREE_CODE (var) == VAR_DECL && DECL_HARD_REGISTER (var)) + if (!ssa_undefined_value_p (t)) return; /* TREE_NO_WARNING either means we already warned, or the front end |