https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61158
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Thu May 15 10:08:12 2014 New Revision: 210469 URL: http://gcc.gnu.org/viewcvs?rev=210469&root=gcc&view=rev Log: PR tree-optimization/61158 * fold-const.c (fold_binary_loc): If X is zero-extended and shiftc >= prec, make sure zerobits is all ones instead of invoking undefined behavior. * gcc.dg/pr61158.c: New test. Added: branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/pr61158.c Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/fold-const.c branches/gcc-4_9-branch/gcc/testsuite/ChangeLog