https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112335
--- Comment #10 from Jonathan Wakely ---
Ah, now I understand what you've been saying about the postcondition.
Yes, but the compiler doesn't know the postcondition, it's just words in the
standard, so not visible to the optimization passes.
It
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112335
--- Comment #9 from Federico Kircheis ---
Great, thank you for the clarifications, your redacted example makes now sense.
> https://godbolt.org/z/WGPTesEb3 shows that bar3 is not the same as bar1,
> because it runs an additional destructor if
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112335
--- Comment #8 from Jonathan Wakely ---
(In reply to Federico Kircheis from comment #7)
> > Demo: https://godbolt.org/z/PWd96j4fz
>
> Thank you for the example, but honestly, I think I am still missing
> something.
>
> If you modify the main t
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112335
--- Comment #7 from Federico Kircheis ---
Thank you Jonathan, I've then misunderstood the example of Andrew, I thought he
was trying to create a scenario where after reset the pointer is not nullptr.
> Demo: https://godbolt.org/z/PWd96j4fz
Tha
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112335
Jonathan Wakely changed:
What|Removed |Added
Resolution|--- |INVALID
Status|UNCONFIRME
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112335
--- Comment #5 from Federico Kircheis ---
Ok, the described case would be something like
std::unique_ptr t;
__thread bool tt;
inline s::~s()
{
if (tt)
return;
tt = true;
t.reset(new s);
tt = false;
}
std::unique_ptr t2;
bar(t,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112335
--- Comment #4 from Andrew Pinski ---
(In reply to Federico Kircheis from comment #2)
> > Well s::~s could touch the reference std::unique_ptr (ps1).
>
> In both cases, s::~s is called only once.
>
> Also during the move-assignment no user-pro
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112335
--- Comment #3 from Federico Kircheis ---
Or maybe I've misunderstood your comment.
Do you have a specific scenario in mind where the two snippets would exhibit
different behaviors?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112335
--- Comment #2 from Federico Kircheis ---
> Well s::~s could touch the reference std::unique_ptr (ps1).
In both cases, s::~s is called only once.
Also during the move-assignment no user-provided-code is involved (except the
destruction of ps1,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112335
--- Comment #1 from Andrew Pinski ---
__old_p_6 = MEM[(struct s * &)ps1_2(D)];
MEM[(struct s * &)ps1_2(D)] = 0B;
if (__old_p_6 != 0B)
goto ; [53.47%]
else
goto ; [46.53%]
[local count: 574129752]:
s::~s (__old_p_6);
opera
10 matches
Mail list logo