public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/60889] New: -Os generate much bigger code
@ 2014-04-18 16:50 hjl.tools at gmail dot com
  2021-09-27  0:37 ` [Bug target/60889] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: hjl.tools at gmail dot com @ 2014-04-18 16:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60889
           Summary: -Os generate much bigger code
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: mjambor at suse dot cz

On Linux/x86-64:

[hjl@gnu-6 gcc]$ cat /tmp/space.i
typedef float __v4sf __attribute__ ((__vector_size__ (16)));
typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
struct S
{
  __m128 a, b;
};

struct T
{
  int a;
  struct S s;
};


void foo (struct T *p, __m128 v)
{
  struct S s;

  s = p->s;
  s.b = (__m128) __builtin_ia32_addps ((__v4sf)s.b, (__v4sf)v);
  p->s = s;
}
[hjl@gnu-6 gcc]$ ./xgcc -B./ -S -O2 /tmp/space.i 
[hjl@gnu-6 gcc]$ cat space.s 
    .file    "space.i"
    .section    .text.unlikely,"ax",@progbits
.LCOLDB0:
    .text
.LHOTB0:
    .p2align 4,,15
    .globl    foo
    .type    foo, @function
foo:
.LFB0:
    .cfi_startproc
    addps    32(%rdi), %xmm0
    movaps    %xmm0, 32(%rdi)
    ret
    .cfi_endproc
.LFE0:
    .size    foo, .-foo
    .section    .text.unlikely
.LCOLDE0:
    .text
.LHOTE0:
    .ident    "GCC: (GNU) 4.9.0 20140409 (experimental)"
    .section    .note.GNU-stack,"",@progbits
[hjl@gnu-6 gcc]$ ./xgcc -B./ -S -Os /tmp/space.i 
[hjl@gnu-6 gcc]$ cat space.s 
    .file    "space.i"
    .section    .text.unlikely,"ax",@progbits
.LCOLDB0:
    .text
.LHOTB0:
    .globl    foo
    .type    foo, @function
foo:
.LFB0:
    .cfi_startproc
    movq    %rdi, %rax
    movl    $8, %ecx
    leaq    -40(%rsp), %rdi
    leaq    16(%rax), %rsi
    rep movsl
    addps    32(%rax), %xmm0
    leaq    16(%rax), %rdi
    leaq    -40(%rsp), %rsi
    movb    $8, %cl
    movaps    %xmm0, -24(%rsp)
    rep movsl
    ret
    .cfi_endproc
.LFE0:
    .size    foo, .-foo
    .section    .text.unlikely
.LCOLDE0:
    .text
.LHOTE0:
    .ident    "GCC: (GNU) 4.9.0 20140409 (experimental)"
    .section    .note.GNU-stack,"",@progbits
[hjl@gnu-6 gcc]$ 

analyze_all_variable_accesses in tree-sra.c has

  max_total_scalarization_size = UNITS_PER_WORD * BITS_PER_UNIT
    * MOVE_RATIO (optimize_function_for_speed_p (cfun));

-Os sets MOVE_RATIO to 3.  Should we have a different parameter
to control SRA?


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

* [Bug target/60889] -Os generate much bigger code
  2014-04-18 16:50 [Bug middle-end/60889] New: -Os generate much bigger code hjl.tools at gmail dot com
@ 2021-09-27  0:37 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-27  0:37 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to fail|                            |6.1.0
      Known to work|                            |7.1.0
   Target Milestone|---                         |7.0
         Resolution|---                         |FIXED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
In GCC 7+, we use TI to do the struct move.

So all fixed in GCC 7+.

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

end of thread, other threads:[~2021-09-27  0:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-18 16:50 [Bug middle-end/60889] New: -Os generate much bigger code hjl.tools at gmail dot com
2021-09-27  0:37 ` [Bug target/60889] " pinskia 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).