[Bug target/83496] MIPS BE: wrong code generates under "-Os -mbranch-cost=1"

paul.hua.gm at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Jan 19 08:33:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83496

Paul Hua <paul.hua.gm at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |paul.hua.gm at gmail dot com

--- Comment #7 from Paul Hua <paul.hua.gm at gmail dot com> ---
git bisect between r235092 and r246594 show :

It's a regression start by r240965.

 commit e55aa189d4c22c3e7992ebfbb7a90514647e219a
Author: rts <rts@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Tue Oct 11 07:58:54 2016 +0000

    [MIPS] Disable -mbranch-likely for -Os when targetting generic arch

    gcc/
        * config/mips/mips-cpus.def: Replace PTF_AVOID_BRANCHLIKELY with
        PTF_AVOID_BRANCHLIKELY_ALWAYS for generic architecture and with
        PTF_AVOID_BRANCHLIKELY_SPEED for others.
        (mips2, mips3, mips4): Add PTF_AVOID_BRANCHLIKELY_SIZE to tune flags.
        * config/mips/mips.c (mips_option_override): Enable the branch likely
        depending on the tune flags and optimization level.
        * config/mips/mips.h (PTF_AVOID_BRANCHLIKELY): Remove.
        (PTF_AVOID_BRANCHLIKELY_SPEED): Define.
        (PTF_AVOID_BRANCHLIKELY_SIZE): Likewise.
        (PTF_AVOID_BRANCHLIKELY_ALWAYS): Likewise.

    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240965
138bc75d-0d04-0410-961f-82ee72b054a4

But the trunk GCC 8.X version is right. continue bisect which version fix this.

Paul Hua.


More information about the Gcc-bugs mailing list