int fund = exp->ex_type->tp_fund;
int vol = 0;
struct type *tp;
+ char *oper_string = symbol2str(oper);
/* We expect an lvalue */
if (!exp->ex_lvalue) {
- expr_error(exp, "no lvalue in operand of %s", symbol2str(oper));
+ expr_error(exp, "no lvalue in operand of %s", oper_string);
} else if (exp->ex_flags & EX_ILVALUE) {
- strict("incorrect lvalue in operand of %s", symbol2str(oper));
+ strict("incorrect lvalue in operand of %s", oper_string);
} else if (exp->ex_flags & EX_READONLY) {
- expr_error(exp, "operand of %s is read-only", symbol2str(oper));
+ expr_error(exp, "operand of %s is read-only", oper_string);
} else if (fund == STRUCT || fund == UNION) {
if (recurconst(exp->ex_type))
expr_error(expr,"operand of %s contains a const-qualified member",
- symbol2str(oper));
+ oper_string);
}
/* Preserve volatile markers across the tree.
expr = extmp;
}
#ifndef NOBITFIELD
- if (fund == FIELD)
- exp = new_oper(exp->ex_type->tp_up, exp, oper, expr);
- else
- exp = new_oper(exp->ex_type, exp, oper, expr);
+ exp = new_oper(fund == FIELD ? exp->ex_type->tp_up : exp->ex_type,
+ exp, oper, expr);
#else NOBITFIELD
exp = new_oper(exp->ex_type, exp, oper, expr);
#endif NOBITFIELD
struct type *tp = leftop->ex_type->tp_up;
arith tmpvar;
struct type *atype = tp->tp_unsigned ? uword_type : word_type;
- arith asize = atype->tp_size;
/* First some assertions to be sure that the rest is legal */
- ASSERT(asize == word_size); /* make sure that C_loc() is legal */
+ ASSERT(atype->tp_size == word_size); /* make sure that C_loc() is legal */
ASSERT(leftop->ex_type->tp_fund == FIELD);
leftop->ex_type = atype; /* this is cheating but it works... */
if (op == '=') {
EVAL(rightop, RVAL, TRUE, NO_LABEL, NO_LABEL);
conversion(tp, atype);
C_loc(fd->fd_mask);
- C_and(asize);
+ C_and(word_size);
if (code == TRUE)
- C_dup(asize);
+ C_dup(word_size);
C_loc((arith)fd->fd_shift);
if (atype->tp_unsigned)
- C_slu(asize);
+ C_slu(word_size);
else
- C_sli(asize);
- C_loc(~((fd->fd_mask << fd->fd_shift) | ~full_mask[asize]));
+ C_sli(word_size);
+ C_loc(~((fd->fd_mask << fd->fd_shift) | ~full_mask[(int)word_size]));
if (leftop->ex_depth == 0) { /* simple case */
load_val(leftop, RVAL);
- C_and(asize);
- C_ior(asize);
+ C_and(word_size);
+ C_ior(word_size);
store_val(&(leftop->EX_VALUE), atype);
}
else { /* complex case */
EVAL(leftop, LVAL, TRUE, NO_LABEL, NO_LABEL);
C_dup(pointer_size);
StoreLocal(tmpvar, pointer_size);
- C_loi(asize);
- C_and(asize);
- C_ior(asize);
+ C_loi(word_size);
+ C_and(word_size);
+ C_ior(word_size);
LoadLocal(tmpvar, pointer_size);
- C_sti(asize);
+ C_sti(word_size);
FreeLocal(tmpvar);
}
}
EVAL(leftop, LVAL, TRUE, NO_LABEL, NO_LABEL);
C_dup(pointer_size);
StoreLocal(tmpvar, pointer_size);
- C_loi(asize);
+ C_loi(word_size);
}
if (atype->tp_unsigned) {
C_loc((arith)fd->fd_shift);
- C_sru(asize);
+ C_sru(word_size);
C_loc(fd->fd_mask);
- C_and(asize);
+ C_and(word_size);
}
else {
- arith bits_in_type = asize * 8;
+ arith bits_in_type = word_size * 8;
C_loc(bits_in_type - (fd->fd_width + fd->fd_shift));
- C_sli(asize);
+ C_sli(word_size);
C_loc(bits_in_type - fd->fd_width);
- C_sri(asize);
+ C_sri(word_size);
}
if (code == TRUE && (op == POSTINCR || op == POSTDECR))
- C_dup(asize);
+ C_dup(word_size);
conversion(atype, rightop->ex_type);
EVAL(rightop, RVAL, TRUE, NO_LABEL, NO_LABEL);
/* the 'op' operation: */
assop(rightop->ex_type, op);
conversion(rightop->ex_type, atype);
C_loc(fd->fd_mask);
- C_and(asize);
+ C_and(word_size);
if (code == TRUE && op != POSTINCR && op != POSTDECR)
- C_dup(asize);
+ C_dup(word_size);
C_loc((arith)fd->fd_shift);
if (atype->tp_unsigned)
- C_slu(asize);
+ C_slu(word_size);
else
- C_sli(asize);
- C_loc(~((fd->fd_mask << fd->fd_shift) | ~full_mask[asize]));
+ C_sli(word_size);
+ C_loc(~((fd->fd_mask << fd->fd_shift) | ~full_mask[(int)word_size]));
if (leftop->ex_depth == 0) {
load_val(leftop, RVAL);
- C_and(asize);
- C_ior(asize);
+ C_and(word_size);
+ C_ior(word_size);
store_val(&(leftop->EX_VALUE), atype);
}
else {
LoadLocal(tmpvar, pointer_size);
- C_loi(asize);
- C_and(asize);
- C_ior(asize);
+ C_loi(word_size);
+ C_and(word_size);
+ C_ior(word_size);
LoadLocal(tmpvar, pointer_size);
- C_sti(asize);
+ C_sti(word_size);
FreeLocal(tmpvar);
}
}
retrieval) is on top of stack.
*/
if (atype->tp_unsigned == 0) { /* sign extension */
- register arith shift = asize * 8 - fd->fd_width;
+ register arith shift = word_size * 8 - fd->fd_width;
C_loc(shift);
- C_sli(asize);
+ C_sli(word_size);
C_loc(shift);
- C_sri(asize);
+ C_sri(word_size);
}
conversion(atype, expr->ex_type);
}