public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "admin@tho-otto.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug modula2/110126] Variables are reported as unused when only referenced by ASM statements
Date: Wed, 07 Jun 2023 05:06:39 +0000	[thread overview]
Message-ID: <bug-110126-4-cSgNCh0shM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110126-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Thorsten Otto <admin@tho-otto.de> ---
But even if i rewrite it like that, i still get the warning.

I avoided doing anything machine specific in the first example, but if i
actually do, and use something like:

PROCEDURE test;
BEGIN
  ASM("movl %1,%%eax; addl $1,%%eax; movl %%eax,%0" : "=r"(x) : "0"(x) :
"eax");
END test;

i still get the warning.

BTW, is there a reason why the string in the asm statement can't be
concatenated?

eg. especially if the statement becomes longer, you would usually want to write
it something like

  ASM("movl %1,%%eax;" +
      "addl $1,%%eax;" +
      "movl %%eax,%0"
     : "=r"(x) : "0"(x) : "eax");

  parent reply	other threads:[~2023-06-07  5:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05 12:45 [Bug modula2/110126] New: " admin@tho-otto.de
2023-06-06 14:26 ` [Bug modula2/110126] " gaius at gcc dot gnu.org
2023-06-07  5:06 ` admin@tho-otto.de [this message]
2023-06-07 12:50 ` gaius at gcc dot gnu.org
2023-06-08 20:33 ` gaius at gcc dot gnu.org
2023-06-08 23:56 ` cvs-commit at gcc dot gnu.org
2023-06-08 23:56 ` gaius at gcc dot gnu.org
2023-06-09  6:21 ` admin@tho-otto.de
2023-06-09  7:19 ` admin@tho-otto.de
2023-06-12 12:26 ` gaius at gcc dot gnu.org
2023-06-12 13:35 ` admin@tho-otto.de
2023-06-12 14:26 ` cvs-commit at gcc dot gnu.org
2023-06-12 14:28 ` gaius at gcc dot gnu.org
2023-06-13 11:36 ` admin@tho-otto.de
2023-07-11 18:13 ` admin@tho-otto.de
2023-07-29 16:25 ` cvs-commit at gcc dot gnu.org
2023-07-29 20:04 ` cvs-commit at gcc dot gnu.org
2023-07-29 20:13 ` gaius 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-110126-4-cSgNCh0shM@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).