From: Tomas Bily Date: Wed, 23 Apr 2008 12:50:17 +0000 (+0200) Subject: tree-cfg.c (verify_expr): Check for NON_LVALUE_EXPR as unreachable case. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a134e5f3702af8504e2744bebd3a034914ab7d40;p=gcc.git tree-cfg.c (verify_expr): Check for NON_LVALUE_EXPR as unreachable case. * tree-cfg.c (verify_expr): Check for NON_LVALUE_EXPR as unreachable case. * tree-vrp.c (extract_range_from_unary_expr): Removed unused NON_LVALUE_EXPR. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-ssa-structalias.c (get_constraint_for): Likewise. * tree-inline.c (estimate_num_insns_1): Likewise. * varasm.c (const_hash_1, compare_constant, copy_constant) (compute_reloc_for_constant, output_addressed_constants): Likewise. * emit-rtl.c (component_ref_for_mem_expr) (set_mem_attributes_minus_bitpos): Likewise. * expr.c (highest_pow2_factor, expand_expr_real_1, ) (is_aligning_offset): Likewise. * dwarf2out.c (loc_descriptor_from_tree_1, add_bound_info): Likewise. * tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): Likewise. * dojump.c (do_jump): Likewise. * builtins.c (get_pointer_alignment, get_memory_rtx) (integer_valued_real_p, fold_builtin_next_arg): Likewise. * tree-scalar-evolution.c (instantiate_parameters_1): Likewise. From-SVN: r134591 --- diff --git a/gcc/builtins.c b/gcc/builtins.c index 761a658bc71..06ecb2475b6 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -281,7 +281,6 @@ get_pointer_alignment (tree exp, unsigned int max_align) { case NOP_EXPR: case CONVERT_EXPR: - case NON_LVALUE_EXPR: exp = TREE_OPERAND (exp, 0); if (! POINTER_TYPE_P (TREE_TYPE (exp))) return align; @@ -1073,8 +1072,7 @@ get_memory_rtx (tree exp, tree len) /* Get an expression we can use to find the attributes to assign to MEM. If it is an ADDR_EXPR, use the operand. Otherwise, dereference it if we can. First remove any nops. */ - while ((TREE_CODE (exp) == NOP_EXPR || TREE_CODE (exp) == CONVERT_EXPR - || TREE_CODE (exp) == NON_LVALUE_EXPR) + while ((TREE_CODE (exp) == NOP_EXPR || TREE_CODE (exp) == CONVERT_EXPR) && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (exp, 0)))) exp = TREE_OPERAND (exp, 0); @@ -1106,7 +1104,6 @@ get_memory_rtx (tree exp, tree len) while (TREE_CODE (inner) == ARRAY_REF || TREE_CODE (inner) == NOP_EXPR || TREE_CODE (inner) == CONVERT_EXPR - || TREE_CODE (inner) == NON_LVALUE_EXPR || TREE_CODE (inner) == VIEW_CONVERT_EXPR || TREE_CODE (inner) == SAVE_EXPR) inner = TREE_OPERAND (inner, 0); @@ -7265,7 +7262,6 @@ integer_valued_real_p (tree t) case ABS_EXPR: case SAVE_EXPR: - case NON_LVALUE_EXPR: return integer_valued_real_p (TREE_OPERAND (t, 0)); case COMPOUND_EXPR: @@ -11435,7 +11431,6 @@ fold_builtin_next_arg (tree exp, bool va_start_p) parameters. */ while (TREE_CODE (arg) == NOP_EXPR || TREE_CODE (arg) == CONVERT_EXPR - || TREE_CODE (arg) == NON_LVALUE_EXPR || TREE_CODE (arg) == INDIRECT_REF) arg = TREE_OPERAND (arg, 0); if (arg != last_parm) diff --git a/gcc/dojump.c b/gcc/dojump.c index b619e0f49de..e7afb7ef0a8 100644 --- a/gcc/dojump.c +++ b/gcc/dojump.c @@ -219,8 +219,7 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) /* Strip narrowing integral type conversions. */ while ((TREE_CODE (exp0) == NOP_EXPR - || TREE_CODE (exp0) == CONVERT_EXPR - || TREE_CODE (exp0) == NON_LVALUE_EXPR) + || TREE_CODE (exp0) == CONVERT_EXPR) && TREE_OPERAND (exp0, 0) != error_mark_node && TYPE_PRECISION (TREE_TYPE (exp0)) <= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (exp0, 0)))) diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 49c13d2afe4..2c7f3184e7c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -9583,7 +9583,6 @@ loc_descriptor_from_tree_1 (tree loc, int want_address) case NOP_EXPR: case CONVERT_EXPR: - case NON_LVALUE_EXPR: case VIEW_CONVERT_EXPR: case SAVE_EXPR: case GIMPLE_MODIFY_STMT: @@ -11212,7 +11211,6 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b case CONVERT_EXPR: case NOP_EXPR: - case NON_LVALUE_EXPR: case VIEW_CONVERT_EXPR: add_bound_info (subrange_die, bound_attr, TREE_OPERAND (bound, 0)); break; diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index aa9e96584a1..b8b19d6d224 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1432,7 +1432,6 @@ component_ref_for_mem_expr (tree ref) /* Now remove any conversions: they don't change what the underlying object is. Likewise for SAVE_EXPR. */ while (TREE_CODE (inner) == NOP_EXPR || TREE_CODE (inner) == CONVERT_EXPR - || TREE_CODE (inner) == NON_LVALUE_EXPR || TREE_CODE (inner) == VIEW_CONVERT_EXPR || TREE_CODE (inner) == SAVE_EXPR) inner = TREE_OPERAND (inner, 0); @@ -1563,7 +1562,6 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, /* Now remove any conversions: they don't change what the underlying object is. Likewise for SAVE_EXPR. */ while (TREE_CODE (t) == NOP_EXPR || TREE_CODE (t) == CONVERT_EXPR - || TREE_CODE (t) == NON_LVALUE_EXPR || TREE_CODE (t) == VIEW_CONVERT_EXPR || TREE_CODE (t) == SAVE_EXPR) t = TREE_OPERAND (t, 0); diff --git a/gcc/expr.c b/gcc/expr.c index 7f386439acc..1bb3d820c8c 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6599,7 +6599,7 @@ highest_pow2_factor (const_tree exp) } break; - case NON_LVALUE_EXPR: case NOP_EXPR: case CONVERT_EXPR: + case NOP_EXPR: case CONVERT_EXPR: case SAVE_EXPR: return highest_pow2_factor (TREE_OPERAND (exp, 0)); @@ -7121,9 +7121,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, } ignore = (target == const0_rtx - || ((code == NON_LVALUE_EXPR || code == NOP_EXPR - || code == CONVERT_EXPR || code == COND_EXPR - || code == VIEW_CONVERT_EXPR) + || ((code == NOP_EXPR || code == CONVERT_EXPR + || code == COND_EXPR || code == VIEW_CONVERT_EXPR) && TREE_CODE (type) == VOID_TYPE)); /* An operation in what may be a bit-field type needs the @@ -8018,7 +8017,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, return expand_call (exp, target, ignore); case PAREN_EXPR: - case NON_LVALUE_EXPR: case NOP_EXPR: case CONVERT_EXPR: if (TREE_OPERAND (exp, 0) == error_mark_node) @@ -9411,8 +9409,7 @@ static int is_aligning_offset (const_tree offset, const_tree exp) { /* Strip off any conversions. */ - while (TREE_CODE (offset) == NON_LVALUE_EXPR - || TREE_CODE (offset) == NOP_EXPR + while (TREE_CODE (offset) == NOP_EXPR || TREE_CODE (offset) == CONVERT_EXPR) offset = TREE_OPERAND (offset, 0); @@ -9428,8 +9425,7 @@ is_aligning_offset (const_tree offset, const_tree exp) /* Look at the first operand of BIT_AND_EXPR and strip any conversion. It must be NEGATE_EXPR. Then strip any more conversions. */ offset = TREE_OPERAND (offset, 0); - while (TREE_CODE (offset) == NON_LVALUE_EXPR - || TREE_CODE (offset) == NOP_EXPR + while (TREE_CODE (offset) == NOP_EXPR || TREE_CODE (offset) == CONVERT_EXPR) offset = TREE_OPERAND (offset, 0); @@ -9437,8 +9433,7 @@ is_aligning_offset (const_tree offset, const_tree exp) return 0; offset = TREE_OPERAND (offset, 0); - while (TREE_CODE (offset) == NON_LVALUE_EXPR - || TREE_CODE (offset) == NOP_EXPR + while (TREE_CODE (offset) == NOP_EXPR || TREE_CODE (offset) == CONVERT_EXPR) offset = TREE_OPERAND (offset, 0); diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index f63f6eb989f..4ab192dffa9 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -3254,6 +3254,9 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) } break; + case NON_LVALUE_EXPR: + gcc_unreachable (); + case NOP_EXPR: case CONVERT_EXPR: case FIX_TRUNC_EXPR: @@ -3261,7 +3264,6 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) case NEGATE_EXPR: case ABS_EXPR: case BIT_NOT_EXPR: - case NON_LVALUE_EXPR: case TRUTH_NOT_EXPR: CHECK_OP (0, "invalid operand to unary operator"); break; diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 665819961c6..687ed95c964 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -2233,7 +2233,6 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data) case EH_FILTER_EXPR: case STATEMENT_LIST: case ERROR_MARK: - case NON_LVALUE_EXPR: case FDESC_EXPR: case VA_ARG_EXPR: case TRY_CATCH_EXPR: diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 29f0dcf8f4c..31b77689b1a 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -2117,7 +2117,6 @@ instantiate_parameters_1 (struct loop *loop, tree chrec, int flags, htab_t cache case NOP_EXPR: case CONVERT_EXPR: - case NON_LVALUE_EXPR: op0 = instantiate_parameters_1 (loop, TREE_OPERAND (chrec, 0), flags, cache, size_expr); if (op0 == chrec_dont_know) diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 93f3be6b502..0687e891686 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -1541,7 +1541,6 @@ may_be_nonaddressable_p (tree expr) return may_be_nonaddressable_p (TREE_OPERAND (expr, 0)); case CONVERT_EXPR: - case NON_LVALUE_EXPR: case NOP_EXPR: return true; diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 6f6eff422da..5323a2ba976 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -2913,7 +2913,6 @@ get_constraint_for (tree t, VEC (ce_s, heap) **results) { case NOP_EXPR: case CONVERT_EXPR: - case NON_LVALUE_EXPR: { tree op = TREE_OPERAND (t, 0); diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c index 9e7dd6eed56..d0d8fb229ab 100644 --- a/gcc/tree-ssa-threadedge.c +++ b/gcc/tree-ssa-threadedge.c @@ -429,8 +429,7 @@ simplify_control_stmt_condition (edge e, cached_lhs = fold (COND_EXPR_COND (dummy_cond)); while (TREE_CODE (cached_lhs) == NOP_EXPR - || TREE_CODE (cached_lhs) == CONVERT_EXPR - || TREE_CODE (cached_lhs) == NON_LVALUE_EXPR) + || TREE_CODE (cached_lhs) == CONVERT_EXPR) cached_lhs = TREE_OPERAND (cached_lhs, 0); fold_undefer_overflow_warnings (is_gimple_min_invariant (cached_lhs), diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index e9106c47f19..95f2a5238da 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -2292,7 +2292,6 @@ extract_range_from_unary_expr (value_range_t *vr, enum tree_code code, if (code == FIX_TRUNC_EXPR || code == FLOAT_EXPR || code == BIT_NOT_EXPR - || code == NON_LVALUE_EXPR || code == CONJ_EXPR) { set_value_range_to_varying (vr); @@ -3957,8 +3956,7 @@ register_edge_assert_for_1 (tree op, enum tree_code code, retval |= register_edge_assert_for_1 (rhs, code, e, bsi); } else if (TREE_CODE (rhs) == NOP_EXPR - || TREE_CODE (rhs) == CONVERT_EXPR - || TREE_CODE (rhs) == NON_LVALUE_EXPR) + || TREE_CODE (rhs) == CONVERT_EXPR) { /* Recurse through the type conversion. */ retval |= register_edge_assert_for_1 (TREE_OPERAND (rhs, 0), diff --git a/gcc/varasm.c b/gcc/varasm.c index bfdf3679301..518fe8a7054 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2815,7 +2815,6 @@ const_hash_1 (const tree exp) case NOP_EXPR: case CONVERT_EXPR: - case NON_LVALUE_EXPR: return const_hash_1 (TREE_OPERAND (exp, 0)) * 7 + 2; default: @@ -2970,7 +2969,6 @@ compare_constant (const tree t1, const tree t2) case NOP_EXPR: case CONVERT_EXPR: - case NON_LVALUE_EXPR: case VIEW_CONVERT_EXPR: return compare_constant (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0)); @@ -3018,7 +3016,6 @@ copy_constant (tree exp) case NOP_EXPR: case CONVERT_EXPR: - case NON_LVALUE_EXPR: case VIEW_CONVERT_EXPR: return build1 (TREE_CODE (exp), TREE_TYPE (exp), copy_constant (TREE_OPERAND (exp, 0))); @@ -3917,7 +3914,6 @@ compute_reloc_for_constant (tree exp) case NOP_EXPR: case CONVERT_EXPR: - case NON_LVALUE_EXPR: case VIEW_CONVERT_EXPR: reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0)); break; @@ -3973,7 +3969,6 @@ output_addressed_constants (tree exp) case NOP_EXPR: case CONVERT_EXPR: - case NON_LVALUE_EXPR: case VIEW_CONVERT_EXPR: output_addressed_constants (TREE_OPERAND (exp, 0)); break;