public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/103383] New: Microblaze bswaphi2
@ 2021-11-23 13:31 rkujoth at motorolasolutions dot com
  2021-11-23 15:03 ` [Bug target/103383] " rkujoth at motorolasolutions dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rkujoth at motorolasolutions dot com @ 2021-11-23 13:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103383
           Summary: Microblaze bswaphi2
           Product: gcc
           Version: 6.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rkujoth at motorolasolutions dot com
  Target Milestone: ---

Came across a weird issue in which GCC tried to stick a bswaphi2 operation in
the delay slot of a beqid. Since the bswaphi2 operation is actually two
Microblaze instructions, it only executed the first instruction when taking the
branch (the byte swap -- swapb).

I don't know anything about target configurations, but I found the target macro
here:
https://github.com/gcc-mirror/gcc/blob/master/gcc/config/microblaze/microblaze.md?plain=1#L369-L375

Looks like support for swaphi2 was added in this commit:
https://github.com/gcc-mirror/gcc/commit/cb8a1637a9914fb25bfbc9604fc20ca5e6c0601e

But, there was an error...it mapped swaphi2 to the Microblaze swaph
instruction, which only performs a half-word swap. That was fixed in this
commit:
https://github.com/gcc-mirror/gcc/commit/e50f5f2e0d3396bd4ab2f799135309de39c96d58

But, I wonder if the "TARGET_REORDER" should have been removed, since the
implementation requires two Microblaze instructions?

Not really sure, but adding -fno-delayed-branch to my compile resolves the
issue for me.

I'm using mb-gcc from Vivado 2017.1, which is based on gcc 6.2.0.

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

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 13:31 [Bug target/103383] New: Microblaze bswaphi2 rkujoth at motorolasolutions dot com
2021-11-23 15:03 ` [Bug target/103383] " rkujoth at motorolasolutions dot com
2021-11-24  3:14 ` pinskia at gcc dot gnu.org
2021-11-24  3:33 ` kujoth at gmail dot com
2021-11-24  3:37 ` pinskia at gcc dot gnu.org
2021-12-02  0:11 ` [Bug target/103383] Microblaze bswaphi2 can cause issues with delay slots pinskia at gcc dot gnu.org
2021-12-02  3:00 ` kujoth at gmail dot com
2021-12-02 15:43 ` eager at eagercon dot com
2021-12-03 14:08 ` rkujoth at motorolasolutions dot com
2021-12-03 15:07 ` rkujoth at motorolasolutions 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).