public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/103882] Register corruption in ASM only functions when optization is -O2/-Os/-O3
Date: Sat, 01 Jan 2022 20:34:12 +0000	[thread overview]
Message-ID: <bug-103882-4-pNL0g6TlVJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103882-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That is solely because you didn't write anything else in the function, try to
put some code around the inline asm and you'll see how it will misbehave even
with noipa attribute.
Your code is invalid as documented in GCC documentation, the behavior is
undefined, it can do anything, break with different optimization levels,
different compiler versions or revisions, it can appear to work in some cases
the way you intended, but it is still broken.

  parent reply	other threads:[~2022-01-01 20:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-31 17:11 [Bug target/103882] New: " krystalgamer at protonmail dot com
2021-12-31 18:53 ` [Bug target/103882] " pinskia at gcc dot gnu.org
2021-12-31 20:48 ` krystalgamer at protonmail dot com
2021-12-31 20:51 ` pinskia at gcc dot gnu.org
2021-12-31 20:51 ` pinskia at gcc dot gnu.org
2021-12-31 22:36 ` jakub at gcc dot gnu.org
2022-01-01 12:45 ` krystalgamer at protonmail dot com
2022-01-01 14:05 ` jakub at gcc dot gnu.org
2022-01-01 14:11 ` jakub at gcc dot gnu.org
2022-01-01 15:06 ` krystalgamer at protonmail dot com
2022-01-01 16:37 ` jakub at gcc dot gnu.org
2022-01-01 19:19 ` krystalgamer at protonmail dot com
2022-01-01 19:47 ` schwab@linux-m68k.org
2022-01-01 20:34 ` jakub at gcc dot gnu.org [this message]
2022-01-01 23:15 ` krystalgamer at protonmail dot com
2022-01-02 13:27 ` jakub at gcc dot gnu.org
2022-01-02 14:40 ` krystalgamer at protonmail dot com
2022-01-02 15:00 ` schwab@linux-m68k.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-103882-4-pNL0g6TlVJ@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).