public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/105463] New: [12/13 Regression] MVE: Wrong code, incorrect alignment assumption
@ 2022-05-03  9:52 acoplan at gcc dot gnu.org
  2022-05-03 11:31 ` [Bug target/105463] " rguenth at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: acoplan at gcc dot gnu.org @ 2022-05-03  9:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105463
           Summary: [12/13 Regression] MVE: Wrong code, incorrect
                    alignment assumption
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: acoplan at gcc dot gnu.org
  Target Milestone: ---

The following code is reduced from gcc.c-torture/execute/pr65369.c:

void foo (unsigned *);
void bar (const unsigned char *block)
{
  unsigned buf[4];
  __builtin_memcpy (buf +  0, block +  0, 4);
  __builtin_memcpy (buf +  1, block +  4, 4);
  __builtin_memcpy (buf +  2, block +  8, 4);
  __builtin_memcpy (buf +  3, block + 12, 4);
  foo (buf);
}

and it is miscompiled, starting in GCC 12, for MVE (with
-march=armv8.1-m.main+mve -O2). We generate:

bar:
        mov     r3, r0
        push    {lr}
        sub     sp, sp, #20
        mov     r0, sp
        vldrw.32        q3, [r3]
        vstrw.32        q3, [r0]
        bl      foo
        add     sp, sp, #20
        ldr     pc, [sp], #4

where vldrw.32 requires a 4-byte aligned address, but the source of course has
no such requirement: memcpy does not require an aligned address.

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

end of thread, other threads:[~2022-09-02 11:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03  9:52 [Bug target/105463] New: [12/13 Regression] MVE: Wrong code, incorrect alignment assumption acoplan at gcc dot gnu.org
2022-05-03 11:31 ` [Bug target/105463] " rguenth at gcc dot gnu.org
2022-05-03 11:34 ` rguenth at gcc dot gnu.org
2022-05-03 13:29 ` acoplan at gcc dot gnu.org
2022-05-03 13:42 ` [Bug target/105463] [11/12/13 " rguenth at gcc dot gnu.org
2022-05-03 14:59 ` rearnsha at gcc dot gnu.org
2022-05-03 16:19 ` acoplan at gcc dot gnu.org
2022-05-13 10:25 ` cvs-commit at gcc dot gnu.org
2022-05-13 10:31 ` [Bug target/105463] [11/12 " rearnsha at gcc dot gnu.org
2022-07-26 11:34 ` rguenth at gcc dot gnu.org
2022-09-02 10:16 ` cvs-commit at gcc dot gnu.org
2022-09-02 11:20 ` [Bug target/105463] [11 " cvs-commit at gcc dot gnu.org
2022-09-02 11:21 ` rearnsha 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).