X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftv%2Ftv.c;h=e4e37da20db6a4653302dcf17d12bd9d7b7f54fe;hb=515a21403ca2fd3bd104cae901ff0239343adf69;hp=f13d52c851728c37407dcda1066d7628c7458e48;hpb=bdacbd77db4138f76e06dde1f0098edfa25e1aa9;p=libfirm diff --git a/ir/tv/tv.c b/ir/tv/tv.c index f13d52c85..e4e37da20 100644 --- a/ir/tv/tv.c +++ b/ir/tv/tv.c @@ -193,8 +193,8 @@ static tarval *get_tarval_overflow(const void *value, int length, ir_mode *mode) case irms_reference: /* addresses always wrap around */ temp = alloca(sc_get_buffer_length()); - sc_val_from_ulong(-1, temp); - sc_and(temp, value, temp); + memcpy(temp, value, sc_get_buffer_length()); + sc_truncate(get_mode_size_bits(mode), temp); /* the sc_ module expects that all bits are set ... */ sign_extend(temp, mode); return get_tarval(temp, length, mode); @@ -206,8 +206,8 @@ static tarval *get_tarval_overflow(const void *value, int length, ir_mode *mode) return get_mode_max(mode); case TV_OVERFLOW_WRAP: temp = alloca(sc_get_buffer_length()); - sc_val_from_ulong(-1, temp); - sc_and(temp, value, temp); + memcpy(temp, value, sc_get_buffer_length()); + sc_truncate(get_mode_size_bits(mode), temp); /* the sc_ module expects that all bits are set ... */ sign_extend(temp, mode); return get_tarval(temp, length, mode); @@ -223,8 +223,8 @@ static tarval *get_tarval_overflow(const void *value, int length, ir_mode *mode) return get_mode_min(mode); case TV_OVERFLOW_WRAP: { char *temp = alloca(sc_get_buffer_length()); - sc_val_from_ulong(-1, temp); - sc_and(temp, value, temp); + memcpy(temp, value, sc_get_buffer_length()); + sc_truncate(get_mode_size_bits(mode), temp); return get_tarval(temp, length, mode); } case TV_OVERFLOW_BAD: @@ -524,13 +524,13 @@ tarval *get_tarval_null(ir_mode *mode) { case irms_control_flow: case irms_memory: case irms_auxiliary: - case irms_internal_boolean: assert(0); break; case irms_float_number: return new_tarval_from_double(0.0, mode); + case irms_internal_boolean: case irms_int_number: return new_tarval_from_long(0l, mode);