public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sirl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug inline-asm/101393] New: PowerPC32 inline assembly broken by commit 2d94f7dea9c73ef3c116a0ddc722724578a860fe
Date: Fri, 09 Jul 2021 13:57:37 +0000	[thread overview]
Message-ID: <bug-101393-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 101393
           Summary: PowerPC32 inline assembly broken by commit
                    2d94f7dea9c73ef3c116a0ddc722724578a860fe
           Product: gcc
           Version: 10.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sirl at gcc dot gnu.org
  Target Milestone: ---

A PowerPC32 GCC configured with "--target=powerpc-unknown-eabi
--enable-languages=c,c++ --with-cpu=403" compiling this snippet:

void test(void)
{
        __asm__ __volatile__("dcread 3,3,0");
}

with "powerpc-unknown-eabi-gcc-10 -c test-ppc.c -o test-ppc-gcc10.o" results
in:

> objdump -d test-ppc-gcc10.o

test-ppc-gcc10.o:     file format elf32-powerpc


Disassembly of section .text:

00000000 <test>:
   0:   7c 63 02 8c     dcread  r3,r3,r0
   4:   4e 80 00 20     blr

With "powerpc-unknown-eabi-gcc-9 -c test-ppc.c -o test-ppc-gcc9.o":

> objdump -d test-ppc-gcc9.o 

test-ppc-gcc9.o:     file format elf32-powerpc


Disassembly of section .text:

00000000 <test>:
   0:   7c 63 03 cc     dcread  r3,r3,r0
   4:   4e 80 00 20     blr

Note the changed encoding for dcread, GCC-9 correctly produces an opcode for
PPC403/PPC440, while GCC-10 onwards produces the opcode for PPC476.
This is caused by the unconditional output of ".machine ppc" by GCC-10,
seemingly overriding the commandline to gas (-m403 -many).

             reply	other threads:[~2021-07-09 13:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09 13:57 sirl at gcc dot gnu.org [this message]
2021-07-13 16:22 ` [Bug target/101393] " segher at gcc dot gnu.org
2021-07-13 16:23 ` segher at gcc dot gnu.org
2021-07-16 14:46 ` sirl at gcc dot gnu.org
2021-07-16 14:56 ` sirl at gcc dot gnu.org
2021-07-16 22:40 ` segher at gcc dot gnu.org
2021-07-16 22:48 ` segher at gcc dot gnu.org
2021-07-21 15:49 ` sirl at gcc dot gnu.org
2021-07-21 16:25 ` segher at gcc dot gnu.org
2021-07-21 17:09 ` sirl at gcc dot gnu.org
2021-07-21 21:23 ` segher at gcc dot gnu.org
2021-07-22  4:04 ` amodra at gmail dot com
2021-07-22  9:47 ` sirl at gcc dot gnu.org
2021-07-22 16:16 ` segher at gcc dot gnu.org
2021-07-22 16:28 ` segher at gcc dot gnu.org
2021-07-22 17:33 ` sirl at gcc dot gnu.org
2021-07-22 17:44 ` sirl at gcc dot gnu.org
2021-07-22 23:17 ` segher at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101393-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).