public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/100704] New: Vector register isn't used to push BLKmode argument onto stack
@ 2021-05-20 13:58 hjl.tools at gmail dot com
  2021-05-20 14:11 ` [Bug target/100704] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: hjl.tools at gmail dot com @ 2021-05-20 13:58 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100704
           Summary: Vector register isn't used to push BLKmode argument
                    onto stack
           Product: gcc
           Version: 11.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: crazylht at gmail dot com, ubizjak at gmail dot com
  Target Milestone: ---
            Target: i386,x86-64

[hjl@gnu-cfl-2 gcc]$ cat /tmp/x.c
struct S
{
  long long s1 __attribute__ ((aligned (8)));
  unsigned s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14;
};

extern struct S array[];

void bar (struct S x);

void
foo (void)
{
  bar (array[0]);
}
[hjl@gnu-cfl-2 gcc]$ gcc -S -O2 /tmp/x.c
[hjl@gnu-cfl-2 gcc]$ cat x.s
        .file   "x.c"
        .text
        .p2align 4
        .globl  foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        subq    $8, %rsp
        .cfi_def_cfa_offset 16
        pushq   array+56(%rip)
        .cfi_def_cfa_offset 24
        pushq   array+48(%rip)
        .cfi_def_cfa_offset 32
        pushq   array+40(%rip)
        .cfi_def_cfa_offset 40
        pushq   array+32(%rip)
        .cfi_def_cfa_offset 48
        pushq   array+24(%rip)
        .cfi_def_cfa_offset 56
        pushq   array+16(%rip)
        .cfi_def_cfa_offset 64
        pushq   array+8(%rip)
        .cfi_def_cfa_offset 72
        pushq   array(%rip)
        .cfi_def_cfa_offset 80
        call    bar
        addq    $72, %rsp
        .cfi_def_cfa_offset 8
        ret
        .cfi_endproc
.LFE0:
        .size   foo, .-foo
        .ident  "GCC: (GNU) 11.1.1 20210428 (Red Hat 11.1.1-1)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-cfl-2 gcc]$ 

[hjl@gnu-cfl-2 gcc]$ ./xgcc -B./ -S -O2 /tmp/x.c -mno-push-args
[hjl@gnu-cfl-2 gcc]$ cat x.s
        .file   "x.c"
        .text
        .p2align 4
        .globl  foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        subq    $72, %rsp
        .cfi_def_cfa_offset 80
        movdqu  array(%rip), %xmm0
        movdqu  array+16(%rip), %xmm1
        movdqu  array+32(%rip), %xmm2
        movdqu  array+48(%rip), %xmm3
        movups  %xmm0, (%rsp)
        movups  %xmm1, 16(%rsp)
        movups  %xmm2, 32(%rsp)
        movups  %xmm3, 48(%rsp)
        call    bar
        addq    $72, %rsp
        .cfi_def_cfa_offset 8
        ret
        .cfi_endproc
.LFE0:
        .size   foo, .-foo
        .ident  "GCC: (GNU) 12.0.0 20210519 (experimental)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-cfl-2 gcc]$ 

There is

#define PUSH_ARGS (TARGET_PUSH_ARGS && !ACCUMULATE_OUTGOING_ARGS)

Can we update PUSH_ARGS to also check function arguments?

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

end of thread, other threads:[~2021-06-17 16:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 13:58 [Bug target/100704] New: Vector register isn't used to push BLKmode argument onto stack hjl.tools at gmail dot com
2021-05-20 14:11 ` [Bug target/100704] " rguenth at gcc dot gnu.org
2021-05-20 15:33 ` hjl.tools at gmail dot com
2021-05-23 12:48 ` hjl.tools at gmail dot com
2021-06-17 13:34 ` cvs-commit at gcc dot gnu.org
2021-06-17 16:01 ` hjl.tools 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).