summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-06 23:59:52 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-12-06 23:59:52 +0000
commit4eb376e3a2290c821d2786aaa8459c10b601e6aa (patch)
tree5f40c8e021feb3e4a02b64b03edcf7ed051a1c76 /gcc/tree-ssa-dom.c
parent0a2849aef7a88bc2429014785d4002ae4d5d4df1 (diff)
downloadgcc-4eb376e3a2290c821d2786aaa8459c10b601e6aa.tar.gz
PR debug/42234
* tree-ssa-dom.c (degenerate_phi_result): Check for NULL phi argument earlier. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155025 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index dd9fd566785..48f423bec61 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -2396,6 +2396,8 @@ degenerate_phi_result (gimple phi)
if (arg == lhs)
continue;
+ else if (!arg)
+ break;
else if (!val)
val = arg;
else if (arg == val)
@@ -2403,7 +2405,7 @@ degenerate_phi_result (gimple phi)
/* We bring in some of operand_equal_p not only to speed things
up, but also to avoid crashing when dereferencing the type of
a released SSA name. */
- else if (!arg || TREE_CODE (val) != TREE_CODE (arg)
+ else if (TREE_CODE (val) != TREE_CODE (arg)
|| TREE_CODE (val) == SSA_NAME
|| !operand_equal_p (arg, val, 0))
break;