https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69546
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Wed Feb 10 18:44:07 2016 New Revision: 233300 URL: https://gcc.gnu.org/viewcvs?rev=233300&root=gcc&view=rev Log: Backported from mainline 2016-01-30 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/69546 * wide-int.cc (wi::divmod_internal): For unsigned division where both operands fit into uhwi, if o1 is 1 and o0 has msb set, if divident_prec is larger than bits per hwi, clear another quotient word and return 2 instead of 1. Similarly for remainder with msb in HWI set, if dividend_prec is larger than bits per hwi. * gcc.dg/torture/pr69546.c: New test. Added: branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr69546-1.c branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr69546-2.c Modified: branches/gcc-5-branch/gcc/ChangeLog branches/gcc-5-branch/gcc/testsuite/ChangeLog branches/gcc-5-branch/gcc/wide-int.cc