public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dimitri.gorokhovik at free dot fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/94485] [10.0.1, c++2a] g++ optimizes away necessary code, accepts arbitrary inline asm
Date: Sat, 04 Apr 2020 15:45:43 +0000 [thread overview]
Message-ID: <bug-94485-4-5LJJ3G9EKs@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94485-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94485
--- Comment #3 from Dimitri Gorokhovik <dimitri.gorokhovik at free dot fr> ---
(In reply to Andrew Pinski from comment #2)
> Also c++20 changes constexpr is handled which is why inline asm is accepted
> now IIRC.
This code:
constexpr auto f()
{
asm("before:");
constexpr auto r = 129;
asm("after:");
return r;
};
produces:
bug-2.cpp: In function ‘constexpr auto f()’:
bug-2.cpp:3:3: error: inline assembly is not a constant expression
3 | asm("before:");
| ^~~
bug-2.cpp:3:3: note: only unevaluated inline assembly is allowed in a
‘constexpr’ function in C++2a
next prev parent reply other threads:[~2020-04-04 15:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-04 15:33 [Bug c++/94485] New: [10.0.1, c++2a] g++ optimizes away the " dimitri.gorokhovik at free dot fr
2020-04-04 15:39 ` [Bug c++/94485] [10.0.1, c++2a] g++ optimizes away necessary " pinskia at gcc dot gnu.org
2020-04-04 15:40 ` pinskia at gcc dot gnu.org
2020-04-04 15:45 ` dimitri.gorokhovik at free dot fr [this message]
2020-04-04 15:49 ` dimitri.gorokhovik at free dot fr
2020-04-19 9:38 ` dimitri.gorokhovik at free dot fr
2020-06-01 13:03 ` dimitri.gorokhovik at free dot fr
2020-09-24 19:45 ` dimitri.gorokhovik at free dot fr
2020-09-24 20:25 ` [Bug c++/94485] Inter-dependency between { tree-sra, ABI, inlining, loop-unrolling } leads to mis-optimization dimitri.gorokhovik at free dot fr
2024-03-27 4:33 ` [Bug ipa/94485] " sjames at gcc dot gnu.org
2024-03-27 4:40 ` sjames at gcc dot gnu.org
2024-03-27 4:58 ` pinskia at gcc dot gnu.org
2024-03-27 5:00 ` pinskia 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-94485-4-5LJJ3G9EKs@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).