summaryrefslogtreecommitdiff
path: root/gcc/ipa-prop.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2009-10-13 13:31:08 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2009-10-13 13:31:08 +0200
commitc4e5fe4b51a5228f734ddf76e680dd9088d59a55 (patch)
treec366eb26ee9527581ae826e651347c89c8a66cbd /gcc/ipa-prop.c
parent3525f49b5a8794cd0b553a53f6d1617cbb6b8c55 (diff)
downloadgcc-c4e5fe4b51a5228f734ddf76e680dd9088d59a55.tar.gz
re PR tree-optimization/41661 (ICE due to IPCP trying to create/fold a REAL typed comparision)
2009-10-13 Martin Jambor <mjambor@suse.cz> PR tree-optimization/41661 * ipa-prop.c (compute_complex_pass_through): Allow only operations that are tcc_comparisons or do not change the type in any un-usleless way. * ipa-cp.c (ipcp_lattice_from_jfunc): Request boolean type when folding tcc_comparison operations. * testsuite/gcc.c-torture/compile/pr41661.c: New test. From-SVN: r152702
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r--gcc/ipa-prop.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 0e6aaf51168..93c407b0826 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -357,6 +357,9 @@ compute_complex_pass_through (struct ipa_node_params *info,
{
if (TREE_CODE (op1) != SSA_NAME
|| !SSA_NAME_IS_DEFAULT_DEF (op1)
+ || (TREE_CODE_CLASS (gimple_expr_code (stmt)) != tcc_comparison
+ && !useless_type_conversion_p (TREE_TYPE (name),
+ TREE_TYPE (op1)))
|| !is_gimple_ip_invariant (op2))
return;