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
This commit is contained in:
parent
4fe2a1a7bc
commit
3a18db48e9
@ -1,3 +1,13 @@
|
||||
2004-07-07 Andrew Pinski <apinski@apple.com>
|
||||
|
||||
* 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 <hongjiu.lu@intel.com>
|
||||
|
||||
* collect2.c (dump_file): Don't call cplus_demangle if
|
||||
|
@ -1,3 +1,8 @@
|
||||
2004-07-07 Andrew Pinski <apinski@apple.com>
|
||||
|
||||
* class.c (instantiate_type): BUFFER_REF is dead.
|
||||
* lex.c (init_operators): IN_EXPR is dead.
|
||||
|
||||
2004-07-07 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/16334
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 = "+";
|
||||
|
||||
|
113
gcc/expr.c
113
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)
|
||||
{
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user