This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ipa/78555] gcc/sreal.c:232:20: runtime error: left shift of negative value -2018967552
- From: "marxin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 02 Dec 2016 08:36:33 +0000
- Subject: [Bug ipa/78555] gcc/sreal.c:232:20: runtime error: left shift of negative value -2018967552
- Auto-submitted: auto-generated
- References: <bug-78555-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78555
--- Comment #8 from Martin Liška <marxin at gcc dot gnu.org> ---
Author: marxin
Date: Fri Dec 2 08:36:01 2016
New Revision: 243163
URL: https://gcc.gnu.org/viewcvs?rev=243163&root=gcc&view=rev
Log:
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.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/sreal.c
trunk/gcc/sreal.h