[Bug rtl-optimization/88349] New: [9 regression][MIPS] Redundant store instructions generated start with r266385

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug rtl-optimization/88349] New: [9 regression][MIPS] Redundant store instructions generated start with r266385

mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88349

            Bug ID: 88349
           Summary: [9 regression][MIPS]  Redundant store instructions
                    generated start with r266385
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: paul.hua.gm at gmail dot com
  Target Milestone: ---

paulhua@gcc122:~/test/debug_mult-16$ cat mult-16.i
typedef int DI __attribute__((mode(DI)));
typedef int SI __attribute__((mode(SI)));

__attribute__((mips16)) SI
f (SI x, SI y)
{
  return ((DI) x * y) >> 32;
}

good asm:

f:
        .frame  $sp,0,$31               # vars= 0, regs= 0/0, args= 0, gp= 0
        .mask   0x00000000,0
        .fmask  0x00000000,0
        mult    $4,$5
        mfhi    $3
        .set    noreorder
        .set    nomacro
        jr      $31
        move    $2,$3
        .set    macro
        .set    reorder

bad asm:

f:
        .frame  $sp,16,$31              # vars= 8, regs= 0/0, args= 0, gp= 8
        .mask   0x00000000,0
        .fmask  0x00000000,0
        addiu   $sp,-16
        mult    $4,$5
        mflo    $2
        mfhi    $3
        sw      $2,8($sp)
        sw      $3,12($sp)
        lw      $2,12($sp)
        .set    noreorder
        .set    nomacro
        jr      $31
        addiu   $sp,16
        .set    macro
        .set    reorder

cmd:

paulhua@gcc122:~/test/debug_mult-16$ ~/build/gcc-r266385_obj/gcc/cc1
-fpreprocessed mult-16.i -mel -quiet -dumpbase mult-16.c -mabi=32 -mgp32
-mlong32 -mno-micromips -march=mips64r2 -mllsc -mips64r2 -mno-shared
-auxbase-strip mult-16.s -O1 -version -fdiagnostics-color=never
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fexpensive-optimizations -ffat-lto-objects -fno-ident -o new.s

cross-gcc configure:
configure MISSING=texinfo MAKEINFO=missing --target=mips64el-linux-gnu
--enable-languages=c,c++
Reply | Threaded
Open this post in threaded view
|

[Bug rtl-optimization/88349] [9 regression][MIPS] Redundant store instructions generated start with r266385

mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88349

--- Comment #1 from Paul Hua <paul.hua.gm at gmail dot com> ---
paulhua@gcc122:~/test/debug_msa$ cat v16i8_cmpi.i
typedef signed char v16i8 __attribute__ ((vector_size(16)));
v16i8 test31_s_v16i8 (v16i8 i) {
        return i < 5;
}

good asm:

test31_s_v16i8:
        .frame  $sp,16,$31              # vars= 0, regs= 1/0, args= 0, gp= 0
        .mask   0x10000000,-8
        .fmask  0x00000000,0
        daddiu  $sp,$sp,-16
        sd      $28,8($sp)
        lui     $28,%hi(%neg(%gp_rel(test31_s_v16i8)))
        daddu   $28,$28,$25
        daddiu  $28,$28,%lo(%neg(%gp_rel(test31_s_v16i8)))
        insert.d        $w0[0],$4
        insert.d        $w0[1],$5
        clti_s.b        $w0,$w0,5
        copy_s.d        $2,$w0[0]
        copy_s.d        $3,$w0[1]
        ld      $28,8($sp)
        .set    noreorder
        .set    nomacro
        j       $31
        daddiu  $sp,$sp,16

bad asm:

test31_s_v16i8:
        .frame  $sp,32,$31              # vars= 16, regs= 1/0, args= 0, gp= 0
        .mask   0x10000000,-8
        .fmask  0x00000000,0
        daddiu  $sp,$sp,-32
        sd      $28,24($sp)
        lui     $28,%hi(%neg(%gp_rel(test31_s_v16i8)))
        daddu   $28,$28,$25
        daddiu  $28,$28,%lo(%neg(%gp_rel(test31_s_v16i8)))
        insert.d        $w0[0],$4
        insert.d        $w0[1],$5
        clti_s.b        $w0,$w0,5
        st.b    $w0,0($sp)
        copy_s.d        $2,$w0[0]
        copy_s.d        $3,$w0[1]
        ld      $28,24($sp)
        .set    noreorder
        .set    nomacro
        j       $31
        daddiu  $sp,$sp,32

cmd:

 ~/build/gcc-r266385_obj/gcc/cc1 -fpreprocessed v16i8_cmpi.i -mel -quiet
-dumpbase v16i8_cmpi.c -mmsa -march=mips64r2 -mabi=64 -mllsc -mips64r2
-mno-shared -auxbase v16i8_cmpi -O1 -version -o  bad.s
Reply | Threaded
Open this post in threaded view
|

[Bug rtl-optimization/88349] [9 regression][MIPS] Redundant store instructions generated start with r266385

mpolacek at gcc dot gnu.org
In reply to this post by mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88349

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ra
             Target|                            |mips
                 CC|                            |vmakarov at gcc dot gnu.org
   Target Milestone|---                         |9.0
Reply | Threaded
Open this post in threaded view
|

[Bug rtl-optimization/88349] [9 regression][MIPS] Redundant store instructions generated start with r266385

mpolacek at gcc dot gnu.org
In reply to this post by mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88349

--- Comment #2 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
Author: vmakarov
Date: Fri Dec  7 16:08:17 2018
New Revision: 266894

URL: https://gcc.gnu.org/viewcvs?rev=266894&root=gcc&view=rev
Log:
2018-12-07  Vladimir Makarov  <[hidden email]>

        PR rtl-optimization/88349
        * ira-costs.c (record_operand_costs): Check bigger reg class on
        NO_REGS.

2018-12-07  Vladimir Makarov  <[hidden email]>

        PR rtl-optimization/88349
        * gcc.target/mips/pr88349.c: New.


Added:
    trunk/gcc/testsuite/gcc.target/mips/pr88349.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ira-costs.c
    trunk/gcc/testsuite/ChangeLog
Reply | Threaded
Open this post in threaded view
|

[Bug rtl-optimization/88349] [9 regression][MIPS] Redundant store instructions generated start with r266385

mpolacek at gcc dot gnu.org
In reply to this post by mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88349

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |law at redhat dot com
         Resolution|---                         |FIXED

--- Comment #3 from Jeffrey A. Law <law at redhat dot com> ---
Fixed by Vlad's commit on the trunk