This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Leslie Zhai <lesliezhai at llvm dot org.cn> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lesliezhai at llvm dot org.cn

--- Comment #9 from Leslie Zhai <lesliezhai at llvm dot org.cn> ---
(In reply to Paul Hua from comment #8)
> On GCC 8.x, the r248351 fixed this.
> 
> commit fd891ec7f659e8785c3ed5757f6e60c95117b837
> Author: segher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
> Date:   Mon May 22 21:20:51 2017 +0000
> 
>     cfgcleanup: Ignore clobbers in bb_is_just_return
>     
>     The function bb_is_just_return finds if the BB it is asked about does
>     just a return and nothing else.  It currently does not allow clobbers
>     in the block either, which we of course can allow just fine.
>     
>     This patch changes that.
>     
>     
>         * cfgcleanup.c (bb_is_just_return): Allow CLOBBERs.
>     
>     gcc/testsuite/
>     
>     
>     
>     git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248351
> 138bc75d-0d04-0410-961f-82ee72b054a4
> 
> 
> Paul Hua


GCC 8.0 Still reproducible:


0000000000000000 <mytest>:
   0:   8c830008        lw      v1,8(a0)
   4:   24020001        li      v0,1
   8:   1062000d        beq     v1,v0,40 <mytest+0x40>
   c:   00000000        nop
  10:   8c830000        lw      v1,0(a0)
  14:   28630002        slti    v1,v1,2
  18:   1060000b        beqz    v1,48 <mytest+0x48>
  1c:   00000000        nop
  20:   dc820010        ld      v0,16(a0)
  24:   dc420000        ld      v0,0(v0)
  28:   00a2182b        sltu    v1,a1,v0
  2c:   14600006        bnez    v1,48 <mytest+0x48>
  30:   00000000        nop
  34:   0045102b        sltu    v0,v0,a1
  38:   03e00008        jr      ra
  3c:   0002102f        dnegu   v0,v0
  40:   03e00008        jr      ra
  44:   2402ffff        li      v0,-1
  48:   03e00008        jr      ra
  4c:   24020001        li      v0,1



$ /opt/mips-gnu-git/bin/mips64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/opt/mips-gnu-git/bin/mips64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/opt/mips-gnu-git/libexec/gcc/mips64-linux-gnu/8.0.1/lto-wrapper
Target: mips64-linux-gnu
Configured with: ../configure --target=mips64-linux-gnu
--host=x86_64-redhat-linux-gnu --build=x86_64-redhat-linux-gnu
--prefix=/opt/mips-gnu-git --disable-decimal-float
--disable-dependency-tracking --disable-gold --disable-libgcj --disable-libgomp
--disable-libmpx --disable-libquadmath --disable-libssp
--disable-libunwind-exceptions --disable-shared --disable-silent-rules
--disable-sjlj-exceptions --disable-threads --enable-__cxa_atexit
--enable-checking=release --enable-gnu-unique-object --enable-initfini-array
--enable-languages=c,c++ --enable-linker-build-id --enable-lto --enable-nls
--enable-obsolete --enable-plugin --enable-targets=all --with-newlib
--with-system-libunwind --with-system-zlib --with-arch=mips64r2 --with-abi=64
--with-arch_32=mips32r2 --with-fp-32=xx --enable-gnu-indirect-function
Thread model: single
gcc version 8.0.1 20180120 (experimental) (GCC)


Regards,
Leslie Zhai

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]