https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111019
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |12.4 Ever confirmed|0 |1 Summary|Optimizer incorrectly |[12/13/14 Regression] |assumes variable is not |Optimizer incorrectly |changed while change |assumes variable is not |happens through another |changed while change |pointer |happens through another | |pointer Keywords| |alias, needs-bisection, | |wrong-code Status|UNCONFIRMED |NEW Last reconfirmed| |2023-08-15 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- I can confirm this with -O3 (but not -O2), even when adding -fno-tree-loop-optimize. -fno-strict-aliasing avoids the issue (but I can't see anything obviously wrong in the sources). The requirement for the bug to show up is inlining Target::~Target, marking it always_inline makes the bug appear at -O2 or -O1 -fstrict-aliasing as well. The bug is we endlessly loop in the Target::~Target loop. Needs further analysis, bisection might help.