end block can also have 0 predecessors
[libfirm] / ir / tv / tv.c
index f13d52c..e4e37da 100644 (file)
@@ -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);