From af75a7ea828d60f103de52f79e2d3f78e315d519 Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Fri, 20 Aug 2004 16:48:00 +0000 Subject: [PATCH] re PR tree-optimization/17111 (tree check ICE in value_insert_into_set_bitmap on inlining a memcmp-like function) 2004-08-20 Daniel Berlin Fix PR tree-optimization/17111 * tree-ssa-pre.c (create_value_expr_from): Don't change the types of non-value_handles. (bitmap_set_contains): All constants are in every set. From-SVN: r86331 --- gcc/ChangeLog | 7 +++++++ gcc/tree-ssa-pre.c | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eaadc038c32..1ec68113158 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-08-20 Daniel Berlin + + Fix PR tree-optimization/17111 + * tree-ssa-pre.c (create_value_expr_from): Don't change the types + of non-value_handles. + (bitmap_set_contains): All constants are in every set. + 2004-08-20 Nathan Sidwell * fold-const.c (round_up, round_down): Use build_int_cst. diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 95ee573aa1a..1267a546b0b 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -629,6 +629,10 @@ set_contains_value (value_set_t set, tree val) static bool bitmap_set_contains (bitmap_set_t set, tree expr) { + /* All constants are in every set. */ + if (is_gimple_min_invariant (get_value_handle (expr))) + return true; + /* XXX: Bitmapped sets only contain SSA_NAME's for now. */ if (TREE_CODE (expr) != SSA_NAME) return false; @@ -734,6 +738,7 @@ static void bitmap_value_insert_into_set (bitmap_set_t set, tree expr) { tree val = get_value_handle (expr); + if (is_gimple_min_invariant (val)) return; @@ -1701,7 +1706,8 @@ create_value_expr_from (tree expr, basic_block block, vuse_optype vuses) tree val = vn_lookup_or_add (op, vuses); if (!is_undefined_value (op)) value_insert_into_set (EXP_GEN (block), op); - TREE_TYPE (val) = TREE_TYPE (TREE_OPERAND (vexpr, i)); + if (TREE_CODE (val) == VALUE_HANDLE) + TREE_TYPE (val) = TREE_TYPE (TREE_OPERAND (vexpr, i)); TREE_OPERAND (vexpr, i) = val; } }