Fix bug generating code for shift of constant zero.

The code generator detects this case, but instead of returning the
constant zero, it breaks out and writes partial code for the shift.
This commit is contained in:
Stephen Williams 2008-11-12 21:46:23 -08:00
parent 9f2b5cd9b7
commit 87654f8661
1 changed files with 3 additions and 3 deletions

View File

@ -1053,7 +1053,7 @@ static struct vector_info draw_binary_expr_lrs(ivl_expr_t exp, unsigned wid)
/* shifting 0 gets 0. */
if (lv.base == 0)
break;
return lv;
if (lv.base < 4) {
struct vector_info tmp;
@ -1088,7 +1088,7 @@ static struct vector_info draw_binary_expr_lrs(ivl_expr_t exp, unsigned wid)
/* shifting 0 gets 0. */
if (lv.base == 0)
break;
return lv;
if (lv.base < 4) {
struct vector_info tmp;
@ -1123,7 +1123,7 @@ static struct vector_info draw_binary_expr_lrs(ivl_expr_t exp, unsigned wid)
/* shifting 0 gets 0. */
if (lv.base == 0)
break;
return lv;
/* Sign extend any constant begets itself, if this
expression is signed. */