*/
char *get_ia32_am_offs(const ir_node *node) {
ia32_attr_t *attr = get_ia32_attr(node);
- char *res = NULL;
+ static char res[64];
if (! attr->am_offs) {
return NULL;
}
- res = obstack_alloc(get_irg_obstack(get_irn_irg(node)), 64);
- snprintf(res, 64, "%+ld", attr->am_offs);
+ snprintf(res, sizeof(res), "%+ld", attr->am_offs);
return res;
}
*/
static void extend_ia32_am_offs(ir_node *node, char *offset, char op) {
ia32_attr_t *attr = get_ia32_attr(node);
- int o;
+ int res, o;
if (! offset || strlen(offset) < 1)
return;
- sscanf(offset, "%d", &o);
+ res = sscanf(offset, "%d", &o);
+ assert(res == 1);
if (op == '-')
attr->am_offs -= o;
else if (op == '+')
- attr->am_offs -= o;
+ attr->am_offs += o;
else
assert(0);
}
attr->cnst_val.tv = get_Const_tarval(cnst);
mode = get_tarval_mode(attr->cnst_val.tv);
if (mode_is_reference(mode) &&
- get_mode_null(mode) == attr->cnst_val.tv)
- attr->cnst_val.tv = get_mode_null(mode_Is);
+ get_mode_null(mode) == attr->cnst_val.tv) {
+ attr->cnst_val.tv = get_mode_null(mode_Iu);
+ }
attr->cnst = get_ident_for_tv(attr->cnst_val.tv);
break;
case iro_SymConst: