https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78720
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Sat Dec 10 12:06:12 2016 New Revision: 243516 URL: https://gcc.gnu.org/viewcvs?rev=243516&root=gcc&view=rev Log: PR tree-optimization/78720 * match.pd (A < 0 ? C : 0): Only optimize for signed A. If shift is negative, sign extend to @1's type and than AND with C. * gcc.c-torture/execute/pr78720.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/execute/pr78720.c Modified: trunk/gcc/ChangeLog trunk/gcc/match.pd trunk/gcc/testsuite/ChangeLog