https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81553
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Fri Dec 15 22:05:00 2017 New Revision: 255717 URL: https://gcc.gnu.org/viewcvs?rev=255717&root=gcc&view=rev Log: Backported from mainline 2017-11-25 Jakub Jelinek <ja...@redhat.com> PR rtl-optimization/81553 * combine.c (simplify_if_then_else): In (if_then_else COND (OP Z C1) Z) to (OP Z (mult COND (C1 * STORE_FLAG_VALUE))) optimization, if OP is a shift where C1 has different mode than the whole shift, use C1's mode for MULT rather than the shift's mode. * gcc.c-torture/compile/pr81553.c: New test. Added: branches/gcc-7-branch/gcc/testsuite/gcc.c-torture/compile/pr81553.c Modified: branches/gcc-7-branch/gcc/ChangeLog branches/gcc-7-branch/gcc/combine.c branches/gcc-7-branch/gcc/testsuite/ChangeLog