Commit 4ea9e1a5 by Aldy Hernandez Committed by Aldy Hernandez

* wide-int.h (hwi_with_prec::hwi_with_prec): Sign extend.

From-SVN: r251260
parent db995e10
2017-08-22 Aldy Hernandez <aldyh@redhat.com>
* wide-int.h (hwi_with_prec::hwi_with_prec): Sign extend.
2017-08-22 Georg-Johann Lay <avr@gjlay.de> 2017-08-22 Georg-Johann Lay <avr@gjlay.de>
PR target/81910 PR target/81910
......
...@@ -1517,8 +1517,12 @@ namespace wi ...@@ -1517,8 +1517,12 @@ namespace wi
inline wi::hwi_with_prec::hwi_with_prec (HOST_WIDE_INT v, unsigned int p, inline wi::hwi_with_prec::hwi_with_prec (HOST_WIDE_INT v, unsigned int p,
signop s) signop s)
: val (v), precision (p), sgn (s) : precision (p), sgn (s)
{ {
if (precision < HOST_BITS_PER_WIDE_INT)
val = sext_hwi (v, precision);
else
val = v;
} }
/* Return a signed integer that has value VAL and precision PRECISION. */ /* Return a signed integer that has value VAL and precision PRECISION. */
......
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