Fix for pr2148500.
This patch fixes the expression width calculation for a multiply operation with an unsized operation. The expression width needs to be at least the minimum of the maximum multiply result width and the width of an integer.
This commit is contained in:
parent
610dedc2b8
commit
b5ad161f90
14
elab_expr.cc
14
elab_expr.cc
|
|
@ -154,6 +154,20 @@ unsigned PEBinary::test_width(Design*des, NetScope*scope,
|
|||
min = lval;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
if (unsized_flag && type_is_vectorable(expr_type)) {
|
||||
unsigned use_wid = wid_left + wid_right;
|
||||
if (use_wid > integer_width)
|
||||
use_wid = integer_width;
|
||||
if (use_wid > min)
|
||||
min = use_wid;
|
||||
}
|
||||
if (wid_left > min)
|
||||
min = wid_left;
|
||||
if (wid_right > min)
|
||||
min = wid_right;
|
||||
break;
|
||||
|
||||
case 'l': // << Should be handled by PEBShift
|
||||
case '<': // < Should be handled by PEBComp
|
||||
case '>': // > Should be handled by PEBComp
|
||||
|
|
|
|||
Loading…
Reference in New Issue