Commit 93a3661e authored by Michael Beck's avatar Michael Beck
Browse files

BugFix:

- get_tarval_overflow(): when in warp mode, the strcalc module expects that ALL
  bits are set (and this includes the HIGH bits)

[r8132]
parent 3f0d6479
......@@ -963,7 +963,7 @@ int sc_get_buffer_length(void)
* Do sign extension if the mode is signed, expects all upper bits
* cleared.
*/
static void sign_extend(char *calc_buffer, ir_mode *mode) {
void sign_extend(char *calc_buffer, ir_mode *mode) {
if (mode_is_signed(mode)) {
int bits = get_mode_size_bits(mode) - 1;
int ofs = bits >> 2;
......
......@@ -120,6 +120,8 @@ enum base_t {
const void *sc_get_buffer(void);
int sc_get_buffer_length(void);
void sign_extend(char *calc_buffer, ir_mode *mode);
/** create an value form a string representation */
void sc_val_from_str(const char *str, unsigned int len, void *buffer, ir_mode *mode);
......
......@@ -194,6 +194,8 @@ static tarval *get_tarval_overflow(const void *value, int length, ir_mode *mode)
char *temp = alloca(sc_get_buffer_length());
sc_val_from_ulong(-1, temp);
sc_and(temp, value, temp);
/* the sc_ module expects that all bits are set ... */
sign_extend(temp, mode);
return get_tarval(temp, length, mode);
}
case TV_OVERFLOW_BAD:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment