https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84044
--- Comment #2 from Geoffrey Allott ---
Or even simply
A a;
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84044
--- Comment #1 from Geoffrey Allott ---
I discovered that in b.cpp a free function
A get() {
return A();
}
also triggers the error. Struct B is not necessary.
Assignee: unassigned at gcc dot gnu.org
Reporter: geoffrey at allott dot email
CC: marxin at gcc dot gnu.org
Target Milestone: ---
a.cpp
=
struct A {
virtual ~A();
};
A::~A() {}
b.cpp
=
struct A {
virtual ~A();
};
struct B {
A a;
A get
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81834
--- Comment #2 from Geoffrey Allott ---
Hi Richard, I agree that this seems quite 'arcane' at first glance; I should
explain that I found it when an empty for loop failed to optimize out in rust -
the reduced test case failed to optimize in clang
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: geoffrey at allott dot email
Target Milestone: ---
The following code:
int main() {
for(int i=0; i += i < 1000, i < 1000;);
}
optimizes on x86_64 to the following code:
main:
.LFB0: