converted to the floating type tp.
*/
register struct expr *exp = *expp;
- int uns = (*expp)->ex_type->tp_unsigned;
+ int uns = exp->ex_type->tp_unsigned;
if (is_cp_cst(exp)) {
*expp = new_expr();
(*expp)->ex_type = word_type;
if (tp->tp_unsigned) { /* don't worry about the sign bit */
- if (fd->fd_width >= 8 * word_size)
+ if (fd->fd_width >= 8 * (int)word_size)
(*expp)->ex_type = uword_type;
ch3bin(expp, RIGHT, intexpr((arith)fd->fd_shift, INT));
ch3bin(expp, '&', intexpr(fd->fd_mask, INT));
}
else { /* take care of the sign bit: sign extend if needed */
- arith bits_in_type = word_size * 8;
+ arith other_bits = (int)word_size * 8 - fd->fd_width;
ch3bin(expp, LEFT,
- intexpr(bits_in_type - fd->fd_width - fd->fd_shift,
+ intexpr(other_bits - fd->fd_shift,
INT)
);
- ch3bin(expp, RIGHT, intexpr(bits_in_type - fd->fd_width, INT));
+ ch3bin(expp, RIGHT, intexpr(other_bits, INT));
}
}
#endif NOBITFIELD
#include "sizes.h"
-#define ATW(arg) ((((arg) + word_size - 1) / word_size) * word_size)
+#if word_size==2 || word_size==4
+#define ATW(arg) (((arg) + (word_size - 1)) & ~ (word_size - 1))
+#else
+#define ATW(arg) ((((arg) + ((int)word_size - 1)) / word_size) * word_size)
+#endif
ops = 0;
break;
}
- if (!ops) tp = tp->tp_up;
+ if (ops) tp = tp->tp_up;
}
dumplevel--;
}
load_cst(val, siz)
arith val, siz;
{
- if (siz <= word_size)
+ if ((int)siz <= (int)word_size)
C_loc(val);
else
- if (siz == dword_size)
+ if ((int)siz == (int)dword_size)
C_ldc(val);
else {
label datlab;
struct type *tp = leftop->ex_type->tp_up;
arith tmpvar = 0;
struct type *atype = ( tp->tp_unsigned
- && fd->fd_width >= 8 * word_size)
+ && fd->fd_width >= 8 * (int)word_size)
? uword_type
: word_type;
C_and(word_size);
}
else {
- arith sft = word_size * 8 - fd->fd_width;
+ arith sft = (int)word_size * 8 - fd->fd_width;
C_loc(sft - fd->fd_shift);
C_sli(word_size);
C_loc(sft);
retrieval) is on top of stack.
*/
if (tp->tp_unsigned == 0) { /* sign extension */
- register arith shift = word_size * 8 - fd->fd_width;
+ register arith shift = (int)word_size * 8 - fd->fd_width;
C_loc(shift);
C_sli(word_size);
scope, i.e., on the lowest possible level.
If defining, the label comes from a label statement.
*/
- if (idf->id_def) {
- register struct def *def = idf->id_def;
-
+ register struct def *def = idf->id_def;
+
+ if (def) {
if (def->df_sc == LABEL) {
if (defining && def->df_initialized)
error("redeclaration of label %s",
}
else {
add_def(idf, LABEL, label_type, L_LOCAL);
+ def = idf->id_def;
}
- if (idf->id_def->df_address == 0)
- idf->id_def->df_address = (arith) text_label();
+ if (def->df_address == 0)
+ def->df_address = (arith) text_label();
if (defining)
- idf->id_def->df_initialized = 1;
+ def->df_initialized = 1;
}
unstack_label(idf)