public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bergner at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/102485] -Wa,-many no longer has any effect
Date: Mon, 04 Oct 2021 17:26:39 +0000	[thread overview]
Message-ID: <bug-102485-4-wqylpuQs57@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102485-4@http.gcc.gnu.org/bugzilla/>

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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amodra at gcc dot gnu.org,
                   |                            |bergner at gcc dot gnu.org,
                   |                            |dje at gcc dot gnu.org,
                   |                            |meissner at gcc dot gnu.org,
                   |                            |segher at gcc dot gnu.org,
                   |                            |wschmidt at gcc dot gnu.org

--- Comment #1 from Peter Bergner <bergner at gcc dot gnu.org> ---
I agree it is GCC's job to emit a ".machine CPU" directive that allows the
assembler to correctly assemble the code GCC generates.  Your test case however
uses inline asm and GCC does not know that you are using the mfppr32 mnemonic. 
The assembler code you write in an inline asm is basically a black box to the
compiler.  It is therefor up to the programmer to ensure that either the
-mcpu=CPU GCC option that is being used (which emits".machine CPU" directive)
is enough to assemble the mnemonics in the inline asm or you have to emit them
in your inline asm.  For the later, you can fix your test case like:

bergner@pike:~$ cat mfppr32.c 
long f () {
  long ppr;
  asm volatile ("mfppr32 %0" : "=r"(ppr));
  return ppr;
}
bergner@pike:~$ cat mfppr32-2.c 
long f () {
  long ppr;
  asm volatile (".machine push\n\
                 .machine power7\n\
                 mfppr32 %0\n\
                 .machine pop" : "=r"(ppr));
  return ppr;
}
bergner@pike:~$ gcc -c mfppr32.c 
/tmp/ccSpp2V8.s: Assembler messages:
/tmp/ccSpp2V8.s:19: Error: unrecognized opcode: `mfppr32'
bergner@pike:~$ gcc -c mfppr32-2.c
bergner@pike:~$

Therefore, I'm not sure there is anything for GCC to do here.

  reply	other threads:[~2021-10-04 17:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-25 21:27 [Bug target/102485] New: " pc at us dot ibm.com
2021-10-04 17:26 ` bergner at gcc dot gnu.org [this message]
2021-10-04 18:17 ` [Bug target/102485] " pc at us dot ibm.com
2021-10-05 22:11 ` segher at gcc dot gnu.org
2021-10-05 22:58 ` bergner at gcc dot gnu.org
2021-10-05 23:41 ` segher at gcc dot gnu.org
2022-02-23 17:11 ` npiggin at gmail dot com
2022-02-23 17:38 ` segher at gcc dot gnu.org
2022-02-24  1:11 ` npiggin at gmail dot com
2022-02-24  1:25 ` npiggin at gmail dot com
2022-02-24 11:07 ` amodra at gmail dot com

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-102485-4-wqylpuQs57@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).