public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/55941] New: [4.8 Regression] Strange copy of double (in struct) to stack
@ 2013-01-11 13:01 glisse at gcc dot gnu.org
  2013-01-11 14:44 ` [Bug target/55941] " jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-01-11 13:01 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55941
           Summary: [4.8 Regression] Strange copy of double (in struct) to
                    stack
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: glisse@gcc.gnu.org
            Target: x86_64-linux-gnu


typedef struct A { double a, b; } A;
double f(A x,double y){return x.a+y;}

generates with gcc -Ofast -S:

    addsd    %xmm0, %xmm2
    movsd    %xmm0, -8(%rsp)
    movapd    %xmm2, %xmm0
    ret

I don't understand what that movsd is doing there?

Note that gcc-4.7 generates the expected:

    addsd    %xmm2, %xmm0
    ret


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

* [Bug target/55941] [4.8 Regression] Strange copy of double (in struct) to stack
  2013-01-11 13:01 [Bug target/55941] New: [4.8 Regression] Strange copy of double (in struct) to stack glisse at gcc dot gnu.org
@ 2013-01-11 14:44 ` jakub at gcc dot gnu.org
  2013-01-11 15:01 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-01-11 14:44 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-01-11
                 CC|                            |jakub at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-11 14:44:23 UTC ---
This first regressed with:
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190492
into:
        movsd   %xmm0, -8(%rsp)
        addsd   %xmm2, %xmm0
and then we regress again with:
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190847
into:
        addsd   %xmm0, %xmm2
        movsd   %xmm0, -8(%rsp)
        movapd  %xmm2, %xmm0


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

* [Bug target/55941] [4.8 Regression] Strange copy of double (in struct) to stack
  2013-01-11 13:01 [Bug target/55941] New: [4.8 Regression] Strange copy of double (in struct) to stack glisse at gcc dot gnu.org
  2013-01-11 14:44 ` [Bug target/55941] " jakub at gcc dot gnu.org
@ 2013-01-11 15:01 ` jakub at gcc dot gnu.org
  2013-02-08 15:44 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-01-11 15:01 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-11 15:01:18 UTC ---
I'd hope that the subreg pass could be able to figure out something out of:
(insn 4 3 5 2 (set (reg:TI 63 [ x ])
        (const_int 0 [0])) pr55941.c:2 85 {*movti_internal_rex64}
     (nil))
(insn 5 4 6 2 (set (subreg:DF (reg:TI 63 [ x ]) 0)
        (reg:DF 64 [ x ])) pr55941.c:2 131 {*movdf_internal_rex64}
     (expr_list:REG_DEAD (reg:DF 64 [ x ])
        (nil)))
(insn 6 5 8 2 (set (subreg:DF (reg:TI 63 [ x ]) 8)
        (reg:DF 22 xmm1 [ x+8 ])) pr55941.c:2 131 {*movdf_internal_rex64}
     (expr_list:REG_DEAD (reg:DF 22 xmm1 [ x+8 ])
        (nil)))
(insn 8 6 9 2 (set (reg:DF 67 [ D.1730 ])
        (reg:DF 23 xmm2 [ y ])) pr55941.c:2 131 {*movdf_internal_rex64}
     (expr_list:REG_DEAD (reg:DF 23 xmm2 [ y ])
        (nil)))
(note 9 8 12 2 NOTE_INSN_FUNCTION_BEG)
(insn 12 9 17 2 (set (reg:DF 67 [ D.1730 ])
        (plus:DF (reg:DF 67 [ D.1730 ])
            (subreg:DF (reg:TI 63 [ x ]) 0))) pr55941.c:2 785
{*fop_df_comm_sse}
     (expr_list:REG_DEAD (reg:TI 63 [ x ])
        (nil)))
(all accesses to pseudo 63 in the listed insns), but it only drops the insn 6,
but doesn't figure out the only user uses the low part and thus propagate the
setter.  Or perhaps should forwprop propagate something like that?


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

* [Bug target/55941] [4.8 Regression] Strange copy of double (in struct) to stack
  2013-01-11 13:01 [Bug target/55941] New: [4.8 Regression] Strange copy of double (in struct) to stack glisse at gcc dot gnu.org
  2013-01-11 14:44 ` [Bug target/55941] " jakub at gcc dot gnu.org
  2013-01-11 15:01 ` jakub at gcc dot gnu.org
@ 2013-02-08 15:44 ` rguenth at gcc dot gnu.org
  2013-02-14 20:41 ` rth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-08 15:44 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
   Target Milestone|---                         |4.8.0


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

* [Bug target/55941] [4.8 Regression] Strange copy of double (in struct) to stack
  2013-01-11 13:01 [Bug target/55941] New: [4.8 Regression] Strange copy of double (in struct) to stack glisse at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-02-08 15:44 ` rguenth at gcc dot gnu.org
@ 2013-02-14 20:41 ` rth at gcc dot gnu.org
  2013-02-15  1:41 ` rth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rth at gcc dot gnu.org @ 2013-02-14 20:41 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Henderson <rth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #3 from Richard Henderson <rth at gcc dot gnu.org> 2013-02-14 20:40:34 UTC ---
Mine.


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

* [Bug target/55941] [4.8 Regression] Strange copy of double (in struct) to stack
  2013-01-11 13:01 [Bug target/55941] New: [4.8 Regression] Strange copy of double (in struct) to stack glisse at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-02-14 20:41 ` rth at gcc dot gnu.org
@ 2013-02-15  1:41 ` rth at gcc dot gnu.org
  2013-02-15  6:07 ` rth at gcc dot gnu.org
  2013-02-15  8:55 ` ubizjak at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: rth at gcc dot gnu.org @ 2013-02-15  1:41 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Richard Henderson <rth at gcc dot gnu.org> 2013-02-15 01:41:33 UTC ---
Author: rth
Date: Fri Feb 15 01:41:29 2013
New Revision: 196071

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196071
Log:
PR target/55941
        * lower-subreg.c (simple_move): Check dest mode instead of src mode.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lower-subreg.c


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

* [Bug target/55941] [4.8 Regression] Strange copy of double (in struct) to stack
  2013-01-11 13:01 [Bug target/55941] New: [4.8 Regression] Strange copy of double (in struct) to stack glisse at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2013-02-15  1:41 ` rth at gcc dot gnu.org
@ 2013-02-15  6:07 ` rth at gcc dot gnu.org
  2013-02-15  8:55 ` ubizjak at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: rth at gcc dot gnu.org @ 2013-02-15  6:07 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Henderson <rth at gcc dot gnu.org> changed:

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

--- Comment #5 from Richard Henderson <rth at gcc dot gnu.org> 2013-02-15 06:07:21 UTC ---
Fixed.


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

* [Bug target/55941] [4.8 Regression] Strange copy of double (in struct) to stack
  2013-01-11 13:01 [Bug target/55941] New: [4.8 Regression] Strange copy of double (in struct) to stack glisse at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2013-02-15  6:07 ` rth at gcc dot gnu.org
@ 2013-02-15  8:55 ` ubizjak at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: ubizjak at gmail dot com @ 2013-02-15  8:55 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Uros Bizjak <ubizjak at gmail dot com> 2013-02-15 08:55:05 UTC ---
With a fix, testcase compiles to (-O2):

f:
        addsd   %xmm0, %xmm2
        movapd  %xmm2, %xmm0
        ret

gcc-4.7 generates:

f:
        addsd   %xmm2, %xmm0
        ret

I have opened PR56339 for this problem.


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

end of thread, other threads:[~2013-02-15  8:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-11 13:01 [Bug target/55941] New: [4.8 Regression] Strange copy of double (in struct) to stack glisse at gcc dot gnu.org
2013-01-11 14:44 ` [Bug target/55941] " jakub at gcc dot gnu.org
2013-01-11 15:01 ` jakub at gcc dot gnu.org
2013-02-08 15:44 ` rguenth at gcc dot gnu.org
2013-02-14 20:41 ` rth at gcc dot gnu.org
2013-02-15  1:41 ` rth at gcc dot gnu.org
2013-02-15  6:07 ` rth at gcc dot gnu.org
2013-02-15  8:55 ` ubizjak at gmail dot com

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).