http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58997
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Mon Nov 11 07:55:25 2013 New Revision: 204662 URL: http://gcc.gnu.org/viewcvs?rev=204662&root=gcc&view=rev Log: Backported from mainline 2013-11-05 Jakub Jelinek <ja...@redhat.com> PR rtl-optimization/58997 * loop-iv.c (iv_subreg): For IV_UNKNOWN_EXTEND, expect get_iv_value to be in iv->mode rather than iv->extend_mode. (iv_extend): Likewise. Otherwise, if iv->extend != extend, use lowpart_subreg on get_iv_value before calling simplify_gen_unary. * loop-unswitch.c (may_unswitch_on): Make sure op[i] is in the right mode. * gcc.c-torture/compile/pr58997.c: New test. Added: branches/gcc-4_8-branch/gcc/testsuite/gcc.c-torture/compile/pr58997.c Modified: branches/gcc-4_8-branch/gcc/ChangeLog branches/gcc-4_8-branch/gcc/loop-iv.c branches/gcc-4_8-branch/gcc/loop-unswitch.c branches/gcc-4_8-branch/gcc/testsuite/ChangeLog