public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/98214] New: SVE: Wrong code with -O3 -msve-vector-bits=512
@ 2020-12-09 11:52 acoplan at gcc dot gnu.org
  2020-12-09 14:11 ` [Bug target/98214] [10/11 Regression] " acoplan at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: acoplan at gcc dot gnu.org @ 2020-12-09 11:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98214
           Summary: SVE: Wrong code with -O3 -msve-vector-bits=512
           Product: gcc
           Version: 11.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: ---

AArch64 GCC miscompiles the following testcase:

long c;
int a;
int e[14];
short b[14];
void d(long *f, long h) { *f ^= h + *f; }
int main() {
  e[2] = 1;
  for (int g = 0; g < 13; g++)
    a = b[g] = e[g];
  d(&c, a);
  for (int g = 0; g < 4; g++)
    d(&c, b[2]);
  if (c != 15)
    __builtin_abort();
}

at -O3 -march=armv8.2-a+sve -msve-vector-bits=512. Looking at the generated
code, it looks like we unconditionally call abort:

main:
        adrp    x0, .LANCHOR0
        add     x0, x0, :lo12:.LANCHOR0
        stp     x29, x30, [sp, -16]!
        mov     w2, 1
        add     x1, x0, 56
        ptrue   p0.b, vl64
        mov     x29, sp
        ldr     q0, [x0, 32]
        str     w2, [x0, 8]
        ldrsh   w2, [x0, 48]
        strh    w2, [x0, 80]
        ld1w    z1.d, p0/z, [x0]
        xtn     v0.4h, v0.4s
        st1h    z1.d, p0, [x1]
        str     w2, [x0, 84]
        str     xzr, [x0, 88]
        str     d0, [x0, 72]
        bl      abort

Possibly related to PR98196.

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

end of thread, other threads:[~2021-02-18 17:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 11:52 [Bug target/98214] New: SVE: Wrong code with -O3 -msve-vector-bits=512 acoplan at gcc dot gnu.org
2020-12-09 14:11 ` [Bug target/98214] [10/11 Regression] " acoplan at gcc dot gnu.org
2020-12-30 17:17 ` rsandifo at gcc dot gnu.org
2020-12-30 17:44 ` rsandifo at gcc dot gnu.org
2020-12-31 16:11 ` cvs-commit at gcc dot gnu.org
2020-12-31 16:51 ` [Bug target/98214] [10 " rsandifo at gcc dot gnu.org
2021-01-12 10:04 ` rsandifo at gcc dot gnu.org
2021-02-18 17:53 ` ktkachov 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).