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