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/gimplify.c | |
parent | e49f4f07da9c797eb0efadb36161b36cdc7fef47 (diff) | |
download | gcc-7b7e6ecdb03f08b99c4738473482b4f749af1de0.zip gcc-7b7e6ecdb03f08b99c4738473482b4f749af1de0.tar.gz gcc-7b7e6ecdb03f08b99c4738473482b4f749af1de0.tar.bz2 |
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/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 54d5c46..a58738e 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -3728,7 +3728,15 @@ tree_to_gimple_tuple (tree *tp) /* Promote partial stores to COMPLEX variables to total stores. *EXPR_P is a MODIFY_EXPR with a lhs of a REAL/IMAGPART_EXPR of a variable with - DECL_GIMPLE_REG_P set. */ + DECL_GIMPLE_REG_P set. + + IMPORTANT NOTE: This promotion is performed by introducing a load of the + other, unmodified part of the complex object just before the total store. + As a consequence, if the object is still uninitialized, an undefined value + will be loaded into a register, which may result in a spurious exception + if the register is floating-point and the value happens to be a signaling + NaN for example. Then the fully-fledged complex operations lowering pass + followed by a DCE pass are necessary in order to fix things up. */ static enum gimplify_status gimplify_modify_expr_complex_part (tree *expr_p, tree *pre_p, bool want_value) @@ -6462,7 +6470,7 @@ gimplify_function_tree (tree fndecl) ret = DECL_RESULT (fndecl); if ((TREE_CODE (TREE_TYPE (ret)) == COMPLEX_TYPE - || TREE_CODE (TREE_TYPE (ret)) == VECTOR_TYPE) + || TREE_CODE (TREE_TYPE (ret)) == VECTOR_TYPE) && !needs_to_live_in_memory (ret)) DECL_GIMPLE_REG_P (ret) = 1; |