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

            Bug ID: 126640
           Summary: riscv: -mtune can introduce misaligned vectors.
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rdapp at gcc dot gnu.org
                CC: kito at gcc dot gnu.org, law at gcc dot gnu.org
  Target Milestone: ---
            Target: riscv

While looking into the the Oilsm proposal, I noticed that with e.g.
-mtune=generic-ooo (which enables misaligned vectors) we do emit misaligned
vectors, regardless of the -march.  IMHO that's wrong and I know that I
introduced this :)  -march=foo -mtune=bar code must always be executable on any
foo architecture even if it's slow.  Potentially faulting vector accesses are
contrary to this principle.  I don't think the blast radius of correcting it
would be too large.  Perhaps we should just define a "generic-ooo" CPU/arch in
addition.

One way or another, right now -mtune can create executables that won't run on
CPUs that trap on misaligned vectors.

Kito, how is the situation on the LLVM side here?

Reply via email to