public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/103094] New: [12 Regression] Incorrect codegen from AArch64 intrinsics
@ 2021-11-05  9:50 tnfchris at gcc dot gnu.org
  2021-11-05  9:50 ` [Bug target/103094] " tnfchris at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-11-05  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103094
           Summary: [12 Regression] Incorrect codegen from AArch64
                    intrinsics
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tnfchris at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64-*

The following testcase

---

#include <arm_neon.h>

void foo (uint8x8x2_t cols_01_23, uint8x8x2_t cols_45_67, uint16_t* outptr0)
{
  uint16x4x4_t cols_01_23_45_67 = { {
    vreinterpret_u16_u8(cols_01_23.val[0]),
    vreinterpret_u16_u8(cols_01_23.val[1]),
    vreinterpret_u16_u8(cols_45_67.val[0]),
    vreinterpret_u16_u8(cols_45_67.val[1])
  } };

  vst4_lane_u16(outptr0, cols_01_23_45_67, 0);
}

---

Causes incorrect codegen

```
foo:
        mov     v4.8b, v0.8b
        mov     v5.8b, v1.8b
        mov     v6.8b, v1.8b
        mov     v7.8b, v2.8b
        st4     {v4.h - v7.h}[0], [x0]
        ret
```

as the same register `v1` is used as source for two inputs.

This happens in cprop_hardreg where a correct RTL

```
(insn 20 37 26 2 (set (reg:V4HI 61 v29 [ __val+8 ])
        (reg:V4HI 36 v4 [ cols_01_23+8 ])) 1158 {*aarch64_simd_movv4hi}
     (nil))
```

is turned into

```
(insn 20 37 26 2 (set (reg:V4HI 61 v29 [ __val+8 ])
        (reg:V4HI 33 v1 [orig:36 cols_01_23+8 ] [36])) 1158
{*aarch64_simd_movv4hi}
     (nil))
```

which is a bogus transform as `v1` is still live and pointing to `cols_45_67`.

started somewhere between g:4096eb50d108a9ccef134f2e891c751b1cc9f6b2 and
g:29a1af24eface3620e348be9429e7c2e872accbc

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

end of thread, other threads:[~2021-12-15 12:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05  9:50 [Bug target/103094] New: [12 Regression] Incorrect codegen from AArch64 intrinsics tnfchris at gcc dot gnu.org
2021-11-05  9:50 ` [Bug target/103094] " tnfchris at gcc dot gnu.org
2021-11-05 12:18 ` tnfchris at gcc dot gnu.org
2021-11-05 12:22 ` pinskia at gcc dot gnu.org
2021-11-05 12:29 ` tnfchris at gcc dot gnu.org
2021-11-06  5:50 ` pinskia at gcc dot gnu.org
2021-11-06 22:33 ` [Bug target/103094] [12 Regression] Incorrect codegen from uint8x8x2_t function arguments pinskia at gcc dot gnu.org
2021-12-13  9:12 ` [Bug target/103094] [12 Regression] AAPCS for new partial vector mode types (e.g. V2x8QI) are incorrect tnfchris at gcc dot gnu.org
2021-12-15 12:19 ` cvs-commit at gcc dot gnu.org
2021-12-15 12:24 ` rsandifo 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).