public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Brian Green <briangreenery@gmail.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Miscompilation: missing assignment in function that might throw
Date: Wed, 30 Aug 2023 20:25:55 +0100	[thread overview]
Message-ID: <CAH6eHdRH2iNRcA7keFvqEHNdQYYPOjUKUYVHnjGnJcrgXf_+oA@mail.gmail.com> (raw)
In-Reply-To: <CAH6eHdRwefbby59UZ27rSs9-_ADRpawkscRwLts4WggCJ-PfKw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 989 bytes --]

On Wed, 30 Aug 2023, 20:23 Jonathan Wakely, <jwakely.gcc@gmail.com> wrote:

>
>
> On Wed, 30 Aug 2023, 18:39 Brian Green via Gcc-help, <gcc-help@gcc.gnu.org>
> wrote:
>
>> I was unable to create an account in the gcc bugzilla, so I am trying to
>> report this here.
>>
>
> Please don't report bugs here. Did you send an email to get an account
> created, as bugzilla says to do? Because I don't see any request from you.
>

Gah, it was in my spam folder, sorry. I'll get the account created now...




>
>
>> The following code should always exit with "5". Starting in g++ 12.1, it
>> will exit with "5" at "-O0" and with random garbage at "-O1" or "-O2".
>>
>> https://godbolt.org/z/T3qTnheYW
>>
>> struct Int {
>>   int value;
>> };
>>
>> __attribute__((noipa)) Int always_throws() { throw 123; }
>>
>> void foo(Int &x) {
>>   try {
>>     x = always_throws();
>>   } catch (...) {
>>   }
>> }
>>
>> int main() {
>>   Int x;
>>   x.value = 5;
>>   foo(x);
>>   return x.value;
>> }
>>
>

      reply	other threads:[~2023-08-30 19:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-30 17:38 Brian Green
2023-08-30 19:23 ` Jonathan Wakely
2023-08-30 19:25   ` Jonathan Wakely [this message]

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=CAH6eHdRH2iNRcA7keFvqEHNdQYYPOjUKUYVHnjGnJcrgXf_+oA@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=briangreenery@gmail.com \
    --cc=gcc-help@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).