Fix runtime error: left shift of negative value (PR
authorMartin Liska <mliska@suse.cz>
Fri, 2 Dec 2016 08:36:01 +0000 (09:36 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Fri, 2 Dec 2016 08:36:01 +0000 (08:36 +0000)
commita4f2895465da4c8856b119a5787b95db345567a9
treed78ade7d79b89f366b780063e24f411faa024243
parent32ff7e39c15206dada1406bdc06e18db9e02d248
Fix runtime error: left shift of negative value (PR

PR ipa/78555
* sreal.c (sreal::to_int): Make absolute value before shifting.
(sreal::operator/): Likewise.
(sreal_verify_negative_division): New test.
(void sreal_c_tests): Call the new test.
* sreal.h (sreal::normalize_up): Use new SREAL_ABS and
SREAL_SIGN macros.
(sreal::normalize_down): Likewise.

From-SVN: r243163
gcc/ChangeLog
gcc/sreal.c
gcc/sreal.h