Re: Miscompilation: missing assignment in function that might throw

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 30 Aug 2023, 18:39 Brian Green via Gcc-help, <gcc-help@xxxxxxxxxxx>
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.



> 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;
> }
>



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux