[Bug c++/52339] using delete ptr1->ptr2 where ptr2 destructor deletes a const ptr1 fails

2023-12-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52339 --- Comment #11 from Andrew Pinski --- (In reply to Andrew Pinski from comment #10) > (In reply to Jakub Jelinek from comment #7) > > Created attachment 54994 [details] > > gcc14-pr52339.patch > > > > Untested fix. > > I think this might fix

[Bug c++/52339] using delete ptr1->ptr2 where ptr2 destructor deletes a const ptr1 fails

2023-11-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52339 --- Comment #10 from Andrew Pinski --- (In reply to Jakub Jelinek from comment #7) > Created attachment 54994 [details] > gcc14-pr52339.patch > > Untested fix. I think this might fix PR 108789 too ...

[Bug c++/52339] using delete ptr1->ptr2 where ptr2 destructor deletes a const ptr1 fails

2023-05-04 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52339 --- Comment #9 from Jason Merrill --- (In reply to Jakub Jelinek from comment #5) > in main it doesn't, as the nop is stripped and the COMPONENT_REF is > TREE_READONLY and !TREE_SIDE_EFFECTS. > tree.cc (save_expr) documents that: >Constants,

[Bug c++/52339] using delete ptr1->ptr2 where ptr2 destructor deletes a const ptr1 fails

2023-05-04 Thread joseph at codesourcery dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52339 --- Comment #8 from joseph at codesourcery dot com --- I think it's valid C99, yes: the VLA size should be evaluated exactly once, when the declaration is passed in the order of execution.

[Bug c++/52339] using delete ptr1->ptr2 where ptr2 destructor deletes a const ptr1 fails

2023-05-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52339 --- Comment #7 from Jakub Jelinek --- Created attachment 54994 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54994=edit gcc14-pr52339.patch Untested fix.

[Bug c++/52339] using delete ptr1->ptr2 where ptr2 destructor deletes a const ptr1 fails

2023-05-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52339 --- Comment #6 from Jakub Jelinek --- Though, walking the whole tree to find them in tree_invariant_p_1 would result in bad compile time complexity, because e.g. skip_simple_arithmetic can call that on both operands of binary expression etc. So,

[Bug c++/52339] using delete ptr1->ptr2 where ptr2 destructor deletes a const ptr1 fails

2023-05-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52339 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org,

[Bug c++/52339] using delete ptr1->ptr2 where ptr2 destructor deletes a const ptr1 fails

2023-05-04 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52339 Jonathan Wakely changed: What|Removed |Added Known to fail||13.1.0, 14.0, 4.1.0, 4.6.2 Last

[Bug c++/52339] using delete ptr1->ptr2 where ptr2 destructor deletes a const ptr1 fails

2023-05-04 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52339 Jonathan Wakely changed: What|Removed |Added CC||gjl at gcc dot gnu.org --- Comment #3

[Bug c++/52339] using delete ptr1-ptr2 where ptr2 destructor deletes a const ptr1 fails

2012-02-22 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52339 Jonathan Wakely redi at gcc dot gnu.org changed: What|Removed |Added Keywords||wrong-code

[Bug c++/52339] using delete ptr1-ptr2 where ptr2 destructor deletes a const ptr1 fails

2012-02-22 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52339 --- Comment #2 from Jonathan Wakely redi at gcc dot gnu.org 2012-02-22 12:48:04 UTC --- b = b.0; a = b-a; D.2361 = a-b; if (D.2361 != 0B) goto D.2362; else goto D.2363; D.2362: D.2364 = a-b; B::~B (D.2364); D.2365