public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/44249] [4.4/4.5/4.6 Regression] IRA generates extra register move
       [not found] <bug-44249-4@http.gcc.gnu.org/bugzilla/>
@ 2010-10-01 12:04 ` jakub at gcc dot gnu.org
  2010-11-24 15:17 ` ebotcazou at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-10-01 12:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44249

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.5                       |4.4.6


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rtl-optimization/44249] [4.4/4.5/4.6 Regression] IRA generates extra register move
       [not found] <bug-44249-4@http.gcc.gnu.org/bugzilla/>
  2010-10-01 12:04 ` [Bug rtl-optimization/44249] [4.4/4.5/4.6 Regression] IRA generates extra register move jakub at gcc dot gnu.org
@ 2010-11-24 15:17 ` ebotcazou at gcc dot gnu.org
  2010-11-24 18:21 ` vmakarov at redhat dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2010-11-24 15:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44249

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2010.11.24 15:14:39
                 CC|                            |ebotcazou at gcc dot
                   |                            |gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2010-11-24 15:14:39 UTC ---
There isn't just an extra move, the code is also different.  Are you sure that
it results in inferior performances?


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rtl-optimization/44249] [4.4/4.5/4.6 Regression] IRA generates extra register move
       [not found] <bug-44249-4@http.gcc.gnu.org/bugzilla/>
  2010-10-01 12:04 ` [Bug rtl-optimization/44249] [4.4/4.5/4.6 Regression] IRA generates extra register move jakub at gcc dot gnu.org
  2010-11-24 15:17 ` ebotcazou at gcc dot gnu.org
@ 2010-11-24 18:21 ` vmakarov at redhat dot com
  2011-04-16 10:53 ` [Bug rtl-optimization/44249] [4.4/4.5/4.6/4.7 " jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: vmakarov at redhat dot com @ 2010-11-24 18:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44249

--- Comment #2 from Vladimir Makarov <vmakarov at redhat dot com> 2010-11-24 17:40:56 UTC ---
Reload creates additional insn for insn

(insn 9 7 11 2 (parallel [
            (set (reg:DI 71)
                (lshiftrt:DI (reg/v:DI 60 [ tag ])
                    (const_int 4 [0x4])))
            (clobber (reg:CC 17 flags))
        ]) b.i:5 533 {*lshrdi3_1}
     (expr_list:REG_DEAD (reg/v:DI 60 [ tag ])
        (expr_list:REG_UNUSED (reg:CC 17 flags)
            (nil))))

That is because r60 and r71 got different registers (0 an 1) even
although there is a copy between r71 and r60 which should result in
getting r70 hard register 0 as r60 one.  It does not happen because
r68 already got 0 and it conflicts with r71:

    r71: preferred GENERAL_REGS, alternative NO_REGS, cover GENERAL_REGS
    r68: preferred AREG, alternative GENERAL_REGS, cover GENERAL_REGS
    r60: preferred GENERAL_REGS, alternative NO_REGS, cover GENERAL_REGS

;; a0(r68,l0) conflicts: a1(r71,l0)

;; a4(r67,l0) conflicts:  cp0:a1(r71)<->a3(r60)@1000:constraint

      Popping a0(r68,l0)  -- assign reg 0
      Popping a3(r60,l0)  -- assign reg 0
      Popping a1(r71,l0)  -- assign reg 1

Analogous insn for gcc-4.3 looks like

(insn:HI 9 7 11 2 b.i:4 (parallel [
            (set (reg/v:DI 58 [ tag ])
                (lshiftrt:DI (reg/v:DI 58 [ tag ])
                    (const_int 4 [0x4])))
            (clobber (reg:CC 17 flags))
        ]) 514 {*lshrdi3_1_rex64} (expr_list:REG_UNUSED (reg:CC 17 flags)
        (nil)))

It means there is no such problem as in gcc4.4+.

Insn 9 for gcc-4.3 is a result of regmove transformation.  I have no
idea why regmove (which is present in gcc4.4+) does not do the same
for gcc4.4+ (probably because of some changes since 4.3).

The problem could be fixed in regmove or in IRA (which is probably
harder).  But I don't know is it worth to do it.  Because such
transformations result in longer live ranges of pseudos and might
result in worse code for other programs.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rtl-optimization/44249] [4.4/4.5/4.6/4.7 Regression] IRA generates extra register move
       [not found] <bug-44249-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2010-11-24 18:21 ` vmakarov at redhat dot com
@ 2011-04-16 10:53 ` jakub at gcc dot gnu.org
  2011-05-02  7:33 ` ebotcazou at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-04-16 10:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44249

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.6                       |4.4.7


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rtl-optimization/44249] [4.4/4.5/4.6/4.7 Regression] IRA generates extra register move
       [not found] <bug-44249-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2011-04-16 10:53 ` [Bug rtl-optimization/44249] [4.4/4.5/4.6/4.7 " jakub at gcc dot gnu.org
@ 2011-05-02  7:33 ` ebotcazou at gcc dot gnu.org
  2012-03-13 15:21 ` [Bug rtl-optimization/44249] [4.5/4.6/4.7/4.8 " jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2011-05-02  7:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44249

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rtl-optimization/44249] [4.5/4.6/4.7/4.8 Regression] IRA generates extra register move
       [not found] <bug-44249-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2011-05-02  7:33 ` ebotcazou at gcc dot gnu.org
@ 2012-03-13 15:21 ` jakub at gcc dot gnu.org
  2012-07-02 11:59 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-13 15:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44249

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.7                       |4.5.4

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-13 12:48:04 UTC ---
4.4 branch is being closed, moving to 4.5.4 target.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rtl-optimization/44249] [4.5/4.6/4.7/4.8 Regression] IRA generates extra register move
       [not found] <bug-44249-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2012-03-13 15:21 ` [Bug rtl-optimization/44249] [4.5/4.6/4.7/4.8 " jakub at gcc dot gnu.org
@ 2012-07-02 11:59 ` rguenth at gcc dot gnu.org
  2012-10-09 21:01 ` [Bug rtl-optimization/44249] [4.6/4.7 " steven at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-02 11:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44249

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.5.4                       |4.6.4

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-02 11:58:03 UTC ---
The 4.5 branch is being closed, adjusting target milestone.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rtl-optimization/44249] [4.6/4.7 Regression] IRA generates extra register move
       [not found] <bug-44249-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2012-07-02 11:59 ` rguenth at gcc dot gnu.org
@ 2012-10-09 21:01 ` steven at gcc dot gnu.org
  2013-04-12 15:18 ` [Bug rtl-optimization/44249] [4.7 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu.org @ 2012-10-09 21:01 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44249

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.6/4.7/4.8 Regression]    |[4.6/4.7 Regression] IRA
                   |IRA generates extra         |generates extra register
                   |register move               |move

--- Comment #5 from Steven Bosscher <steven at gcc dot gnu.org> 2012-10-09 21:01:08 UTC ---
No extra move with trunk today:

$ cat t.c
extern unsigned long table[];

unsigned long foo(unsigned char *p) {
    unsigned long tag = *p;
    return table[tag >> 4] + table[tag & 0xf];
}

$ cat t.s
        .file   "t.c"
        .text
        .p2align 4,,15
        .globl  foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        movzbl  (%rdi), %edx
        movq    %rdx, %rax
        shrq    $4, %rdx
        andl    $15, %eax
        movq    table(,%rax,8), %rax
        addq    table(,%rdx,8), %rax
        ret
        .cfi_endproc
.LFE0:
        .size   foo, .-foo
        .ident  "GCC: (GNU) 4.8.0 20121008 (experimental) \
[trunk revision 192219]"
        .section        .note.GNU-stack,"",@progbits


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rtl-optimization/44249] [4.7 Regression] IRA generates extra register move
       [not found] <bug-44249-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2012-10-09 21:01 ` [Bug rtl-optimization/44249] [4.6/4.7 " steven at gcc dot gnu.org
@ 2013-04-12 15:18 ` jakub at gcc dot gnu.org
  2014-06-12 12:57 ` rguenth at gcc dot gnu.org
  2015-06-22 14:23 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-12 15:18 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44249

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.6.4                       |4.7.4

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-12 15:17:03 UTC ---
GCC 4.6.4 has been released and the branch has been closed.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rtl-optimization/44249] [4.7 Regression] IRA generates extra register move
       [not found] <bug-44249-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2013-04-12 15:18 ` [Bug rtl-optimization/44249] [4.7 " jakub at gcc dot gnu.org
@ 2014-06-12 12:57 ` rguenth at gcc dot gnu.org
  2015-06-22 14:23 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-12 12:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.8.0
   Target Milestone|4.7.4                       |4.8.0
      Known to fail|                            |4.7.4

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed with LRA.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug rtl-optimization/44249] [4.7 Regression] IRA generates extra register move
       [not found] <bug-44249-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2014-06-12 12:57 ` rguenth at gcc dot gnu.org
@ 2015-06-22 14:23 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-22 14:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-06-22 14:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-44249-4@http.gcc.gnu.org/bugzilla/>
2010-10-01 12:04 ` [Bug rtl-optimization/44249] [4.4/4.5/4.6 Regression] IRA generates extra register move jakub at gcc dot gnu.org
2010-11-24 15:17 ` ebotcazou at gcc dot gnu.org
2010-11-24 18:21 ` vmakarov at redhat dot com
2011-04-16 10:53 ` [Bug rtl-optimization/44249] [4.4/4.5/4.6/4.7 " jakub at gcc dot gnu.org
2011-05-02  7:33 ` ebotcazou at gcc dot gnu.org
2012-03-13 15:21 ` [Bug rtl-optimization/44249] [4.5/4.6/4.7/4.8 " jakub at gcc dot gnu.org
2012-07-02 11:59 ` rguenth at gcc dot gnu.org
2012-10-09 21:01 ` [Bug rtl-optimization/44249] [4.6/4.7 " steven at gcc dot gnu.org
2013-04-12 15:18 ` [Bug rtl-optimization/44249] [4.7 " jakub at gcc dot gnu.org
2014-06-12 12:57 ` rguenth at gcc dot gnu.org
2015-06-22 14:23 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).