diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-12 17:55:40 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-12 17:55:40 +0000 |
commit | b14e6fc55db1a3b0e65ed88b96bb9db2dddaecc8 (patch) | |
tree | 02177c03b81a087298a7b2263003b285c76e716a /gcc/ipa-cp.c | |
parent | 253f99545e56bc2c7400cc4602f2325f904acd69 (diff) | |
download | gcc-b14e6fc55db1a3b0e65ed88b96bb9db2dddaecc8.tar.gz |
2009-08-12 Richard Guenther <rguenther@suse.de>
PR tree-optimization/41011
* ipa-cp.c (ipcp_lattice_from_jfunc): Deal with failing fold
and reference constructing.
* gfortran.dg/pr41011.f: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150705 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r-- | gcc/ipa-cp.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index df6972417bd..f7782cbbf83 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -302,7 +302,8 @@ ipcp_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat, cst = fold_binary (jfunc->value.pass_through.operation, TREE_TYPE (cst), cst, jfunc->value.pass_through.operand); - gcc_assert (cst && is_gimple_ip_invariant (cst)); + if (!cst || !is_gimple_ip_invariant (cst)) + lat->type = IPA_BOTTOM; lat->constant = cst; } else if (jfunc->type == IPA_JF_ANCESTOR) @@ -325,8 +326,13 @@ ipcp_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat, ok = build_ref_for_offset (&t, TREE_TYPE (t), jfunc->value.ancestor.offset, jfunc->value.ancestor.type, false); - gcc_assert (ok); - lat->constant = build_fold_addr_expr (t); + if (!ok) + { + lat->type = IPA_BOTTOM; + lat->constant = NULL_TREE; + } + else + lat->constant = build_fold_addr_expr (t); } else lat->type = IPA_BOTTOM; |