This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/65492] Bad optimization in -O3 due to if-conversion and/or unrolling
- From: "linux at carewolf dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 31 Mar 2015 10:44:37 +0000
- Subject: [Bug tree-optimization/65492] Bad optimization in -O3 due to if-conversion and/or unrolling
- Auto-submitted: auto-generated
- References: <bug-65492-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65492
--- Comment #12 from Allan Jensen <linux at carewolf dot com> ---
I have a very crude fix for this.
First though, according to comments in tree-if-conv.c and earlier bugs on the
issues. If-conversion is suppposed to be conditional. It performed in a piece
of conditionally code only to be used if vectorized. For some reason this
version appears to be used.
But secondly. If conditional move instructions are generally slower than
branches, shouldn't they be avoided during instruction selections? The crude
fix is simply placing a 'return false;' in the top of ix86_expand_int_movcc in
i386.c.
So this case somehow triggers a case where the if-conversion that is supposed
to only be used by vectorization gets used anyway, but more generally, i386
shouldn't be generating cmov instructions for conditional moves in the first
place for modern architectures (anything newer than core2 and bulldozer). At
least not without input from a profile run.