aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-03-21 14:27:32 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-03-21 14:27:32 +0000
commit6d1a7fd4507f94d5ba1ac3216330280a4751a599 (patch)
tree18b7ef21746ac24ef6c1d79d6e6d37f58ce0d026 /gcc/tree.c
parente2186cd88ed9015ad0cd6f265daa164648d30f74 (diff)
downloadgcc-6d1a7fd4507f94d5ba1ac3216330280a4751a599.zip
gcc-6d1a7fd4507f94d5ba1ac3216330280a4751a599.tar.gz
gcc-6d1a7fd4507f94d5ba1ac3216330280a4751a599.tar.bz2
re PR middle-end/89779 (internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in tree_nop_conversion_p, at tree.c:12798)
2019-03-21 Richard Biener <rguenther@suse.de> PR tree-optimization/89779 * tree.c (tree_nop_conversion): Consolidate and fix defensive checks with respect to released SSA names now having error_mark_node type. * fold-const.c (operand_equal_p): Likewise. * gcc.dg/torture/pr89779.c: New testcase. From-SVN: r269838
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 8ea4251..ae8ff08 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -12812,13 +12812,10 @@ tree_nop_conversion (const_tree exp)
if (!CONVERT_EXPR_P (exp)
&& TREE_CODE (exp) != NON_LVALUE_EXPR)
return false;
- if (TREE_OPERAND (exp, 0) == error_mark_node)
- return false;
outer_type = TREE_TYPE (exp);
inner_type = TREE_TYPE (TREE_OPERAND (exp, 0));
-
- if (!inner_type)
+ if (!inner_type || inner_type == error_mark_node)
return false;
return tree_nop_conversion_p (outer_type, inner_type);