diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-19 14:54:34 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-19 14:54:34 +0000 |
commit | 25f48be00f733aaea20b5ad57902ab4393be40e6 (patch) | |
tree | 02c66940d76557ca76c3cfc4affa106d1affc4c2 | |
parent | 98a5f45d2bdb69c2792f9876489aa580b6f09d52 (diff) | |
download | gcc-25f48be00f733aaea20b5ad57902ab4393be40e6.tar.gz |
2011-10-19 Richard Guenther <rguenther@suse.de>
PR middle-end/50780
* tree-ssa-forwprop.c (forward_propagate_into_cond): Verify
the condition is properly gimple before using it.
* tree-eh (stmt_could_throw_1_p): Properly extract the
operation type from comparisons.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180192 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/tree-eh.c | 8 | ||||
-rw-r--r-- | gcc/tree-ssa-forwprop.c | 3 |
3 files changed, 17 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3eb106f78f2..e9b48b60c59 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2011-10-19 Richard Guenther <rguenther@suse.de> + + PR middle-end/50780 + * tree-ssa-forwprop.c (forward_propagate_into_cond): Verify + the condition is properly gimple before using it. + * tree-eh (stmt_could_throw_1_p): Properly extract the + operation type from comparisons. + 2011-10-19 Roland Stigge <stigge@antcom.de> PR translation/48638 diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index f751d8d98a2..c1896be228d 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -2512,7 +2512,13 @@ stmt_could_throw_1_p (gimple stmt) || TREE_CODE_CLASS (code) == tcc_unary || TREE_CODE_CLASS (code) == tcc_binary) { - t = gimple_expr_type (stmt); + if (is_gimple_assign (stmt) + && TREE_CODE_CLASS (code) == tcc_comparison) + t = TREE_TYPE (gimple_assign_rhs1 (stmt)); + else if (gimple_code (stmt) == GIMPLE_COND) + t = TREE_TYPE (gimple_cond_lhs (stmt)); + else + t = gimple_expr_type (stmt); fp_operation = FLOAT_TYPE_P (t); if (fp_operation) { diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index 1db93a65a65..d707db520e3 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -597,7 +597,8 @@ forward_propagate_into_cond (gimple_stmt_iterator *gsi_p) } } - if (tmp) + if (tmp + && is_gimple_condexpr (tmp)) { if (dump_file && tmp) { |