From: Andrew Pinski Date: Wed, 7 Jul 2004 21:26:31 +0000 (+0000) Subject: expr.c (expand_expr_real_1): Fix formating. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3a18db48e967ad9d788c1ffc1eae3d1ecd99f903;p=gcc.git expr.c (expand_expr_real_1): Fix formating. * expr.c (expand_expr_real_1): Fix formating. BUFFER_REF and IN_EXPR are dead. * fold-const.c (non_lvalue): BUFFER_REF is dead. * tree-inline.c (estimate_num_insns_1): Likewise. * tree-pretty-print.c (dump_generic_node): BUFFER_REF, IN_EXPR, SET_LE_EXPR, and CARD_EXPR are dead. * tree.def (BUFFER_REF, IN_EXPR, SET_LE_EXPR, CARD_EXPR): Kill. cp/ChangeLog: * class.c (instantiate_type): BUFFER_REF is dead. * lex.c (init_operators): IN_EXPR is dead. From-SVN: r84230 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d5cef42c0d..134e1ea2a60 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2004-07-07 Andrew Pinski + + * expr.c (expand_expr_real_1): Fix formating. + BUFFER_REF and IN_EXPR are dead. + * fold-const.c (non_lvalue): BUFFER_REF is dead. + * tree-inline.c (estimate_num_insns_1): Likewise. + * tree-pretty-print.c (dump_generic_node): BUFFER_REF, + IN_EXPR, SET_LE_EXPR, and CARD_EXPR are dead. + * tree.def (BUFFER_REF, IN_EXPR, SET_LE_EXPR, CARD_EXPR): Kill. + 2004-07-07 H.J. Lu * collect2.c (dump_file): Don't call cplus_demangle if diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d575410729e..839745b3a84 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2004-07-07 Andrew Pinski + + * class.c (instantiate_type): BUFFER_REF is dead. + * lex.c (init_operators): IN_EXPR is dead. + 2004-07-07 Jason Merrill PR c++/16334 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 4cfa5875a90..e4117278690 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -6053,7 +6053,6 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags) case CONVERT_EXPR: case SAVE_EXPR: case CONSTRUCTOR: - case BUFFER_REF: abort (); return error_mark_node; diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index f47aa931ce5..2e3bccdaac2 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -150,7 +150,6 @@ init_operators (void) operator_name_info [(int) ABS_EXPR].name = "abs"; operator_name_info [(int) TRUTH_AND_EXPR].name = "strict &&"; operator_name_info [(int) TRUTH_OR_EXPR].name = "strict ||"; - operator_name_info [(int) IN_EXPR].name = "in"; operator_name_info [(int) RANGE_EXPR].name = "..."; operator_name_info [(int) CONVERT_EXPR].name = "+"; diff --git a/gcc/expr.c b/gcc/expr.c index 8f03a69a584..b9fd93863e0 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6443,8 +6443,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, original_target = target; ignore = (target == const0_rtx || ((code == NON_LVALUE_EXPR || code == NOP_EXPR - || code == CONVERT_EXPR || code == COND_EXPR - || code == VIEW_CONVERT_EXPR) + || code == CONVERT_EXPR || code == COND_EXPR + || code == VIEW_CONVERT_EXPR) && TREE_CODE (type) == VOID_TYPE)); /* If we are going to ignore this result, we need only do something @@ -6472,7 +6472,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, } if (TREE_CODE_CLASS (code) == '1' || code == COMPONENT_REF - || code == INDIRECT_REF || code == BUFFER_REF) + || code == INDIRECT_REF) return expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, modifier); @@ -7345,113 +7345,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, case OBJ_TYPE_REF: return expand_expr (OBJ_TYPE_REF_EXPR (exp), target, tmode, modifier); - /* Intended for a reference to a buffer of a file-object in Pascal. - But it's not certain that a special tree code will really be - necessary for these. INDIRECT_REF might work for them. */ - case BUFFER_REF: - abort (); - - case IN_EXPR: - { - /* Pascal set IN expression. - - Algorithm: - rlo = set_low - (set_low%bits_per_word); - the_word = set [ (index - rlo)/bits_per_word ]; - bit_index = index % bits_per_word; - bitmask = 1 << bit_index; - return !!(the_word & bitmask); */ - - tree set = TREE_OPERAND (exp, 0); - tree index = TREE_OPERAND (exp, 1); - int iunsignedp = TYPE_UNSIGNED (TREE_TYPE (index)); - tree set_type = TREE_TYPE (set); - tree set_low_bound = TYPE_MIN_VALUE (TYPE_DOMAIN (set_type)); - tree set_high_bound = TYPE_MAX_VALUE (TYPE_DOMAIN (set_type)); - rtx index_val = expand_expr (index, 0, VOIDmode, 0); - rtx lo_r = expand_expr (set_low_bound, 0, VOIDmode, 0); - rtx hi_r = expand_expr (set_high_bound, 0, VOIDmode, 0); - rtx setval = expand_expr (set, 0, VOIDmode, 0); - rtx setaddr = XEXP (setval, 0); - enum machine_mode index_mode = TYPE_MODE (TREE_TYPE (index)); - rtx rlow; - rtx diff, quo, rem, addr, bit, result; - - /* If domain is empty, answer is no. Likewise if index is constant - and out of bounds. */ - if (((TREE_CODE (set_high_bound) == INTEGER_CST - && TREE_CODE (set_low_bound) == INTEGER_CST - && tree_int_cst_lt (set_high_bound, set_low_bound)) - || (TREE_CODE (index) == INTEGER_CST - && TREE_CODE (set_low_bound) == INTEGER_CST - && tree_int_cst_lt (index, set_low_bound)) - || (TREE_CODE (set_high_bound) == INTEGER_CST - && TREE_CODE (index) == INTEGER_CST - && tree_int_cst_lt (set_high_bound, index)))) - return const0_rtx; - - if (target == 0) - target = gen_reg_rtx (tmode != VOIDmode ? tmode : mode); - - /* If we get here, we have to generate the code for both cases - (in range and out of range). */ - - op0 = gen_label_rtx (); - op1 = gen_label_rtx (); - - if (! (GET_CODE (index_val) == CONST_INT - && GET_CODE (lo_r) == CONST_INT)) - emit_cmp_and_jump_insns (index_val, lo_r, LT, NULL_RTX, - GET_MODE (index_val), iunsignedp, op1); - - if (! (GET_CODE (index_val) == CONST_INT - && GET_CODE (hi_r) == CONST_INT)) - emit_cmp_and_jump_insns (index_val, hi_r, GT, NULL_RTX, - GET_MODE (index_val), iunsignedp, op1); - - /* Calculate the element number of bit zero in the first word - of the set. */ - if (GET_CODE (lo_r) == CONST_INT) - rlow = GEN_INT (INTVAL (lo_r) - & ~((HOST_WIDE_INT) 1 << BITS_PER_UNIT)); - else - rlow = expand_binop (index_mode, and_optab, lo_r, - GEN_INT (~((HOST_WIDE_INT) 1 << BITS_PER_UNIT)), - NULL_RTX, iunsignedp, OPTAB_LIB_WIDEN); - - diff = expand_binop (index_mode, sub_optab, index_val, rlow, - NULL_RTX, iunsignedp, OPTAB_LIB_WIDEN); - - quo = expand_divmod (0, TRUNC_DIV_EXPR, index_mode, diff, - GEN_INT (BITS_PER_UNIT), NULL_RTX, iunsignedp); - rem = expand_divmod (1, TRUNC_MOD_EXPR, index_mode, index_val, - GEN_INT (BITS_PER_UNIT), NULL_RTX, iunsignedp); - - addr = memory_address (byte_mode, - expand_binop (index_mode, add_optab, diff, - setaddr, NULL_RTX, iunsignedp, - OPTAB_LIB_WIDEN)); - - /* Extract the bit we want to examine. */ - bit = expand_shift (RSHIFT_EXPR, byte_mode, - gen_rtx_MEM (byte_mode, addr), - make_tree (TREE_TYPE (index), rem), - NULL_RTX, 1); - result = expand_binop (byte_mode, and_optab, bit, const1_rtx, - GET_MODE (target) == byte_mode ? target : 0, - 1, OPTAB_LIB_WIDEN); - - if (result != target) - convert_move (target, result, 1); - - /* Output the code to handle the out-of-range case. */ - emit_jump (op0); - emit_label (op1); - emit_move_insn (target, const0_rtx); - emit_label (op0); - return target; - } - case WITH_CLEANUP_EXPR: if (WITH_CLEANUP_EXPR_RTL (exp) == 0) { diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 38547777ca0..b68e4708798 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2023,7 +2023,6 @@ non_lvalue (tree x) case ARRAY_REF: case ARRAY_RANGE_REF: case BIT_FIELD_REF: - case BUFFER_REF: case OBJ_TYPE_REF: case REALPART_EXPR: diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index be817239e6c..2172f33203b 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1184,7 +1184,6 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data) case COMPONENT_REF: case BIT_FIELD_REF: case INDIRECT_REF: - case BUFFER_REF: case ARRAY_REF: case ARRAY_RANGE_REF: case OBJ_TYPE_REF: diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index 3ff23f753b1..743524f481e 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -641,10 +641,6 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, pp_string (buffer, ">"); break; - case BUFFER_REF: - NIY; - break; - case ARRAY_REF: case ARRAY_RANGE_REF: op0 = TREE_OPERAND (node, 0); @@ -1054,18 +1050,6 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, pp_character (buffer, '>'); break; - case IN_EXPR: - NIY; - break; - - case SET_LE_EXPR: - NIY; - break; - - case CARD_EXPR: - NIY; - break; - case RANGE_EXPR: NIY; break; diff --git a/gcc/tree.def b/gcc/tree.def index b6897a787b1..70af240a38f 100644 --- a/gcc/tree.def +++ b/gcc/tree.def @@ -372,9 +372,6 @@ DEFTREECODE (BIT_FIELD_REF, "bit_field_ref", 'r', 3) /* C unary `*' or Pascal `^'. One operand, an expression for a pointer. */ DEFTREECODE (INDIRECT_REF, "indirect_ref", 'r', 1) -/* Pascal `^` on a file. One operand, an expression for the file. */ -DEFTREECODE (BUFFER_REF, "buffer_ref", 'r', 1) - /* Array indexing. Operand 0 is the array; operand 1 is a (single) array index. Operand 2, if present, is a copy of TYPE_MIN_VALUE of the index. @@ -693,10 +690,6 @@ DEFTREECODE (UNEQ_EXPR, "uneq_expr", '<', 2) /* This is the reverse of uneq_expr. */ DEFTREECODE (LTGT_EXPR, "ltgt_expr", '<', 2) -/* Operations for Pascal sets. Not used now. */ -DEFTREECODE (IN_EXPR, "in_expr", '2', 2) -DEFTREECODE (SET_LE_EXPR, "set_le_expr", '<', 2) -DEFTREECODE (CARD_EXPR, "card_expr", '1', 1) DEFTREECODE (RANGE_EXPR, "range_expr", '2', 2) /* Represents a conversion of type of a value.