https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809
--- Comment #7 from Gareth Lloyd ---
To give extra context, this optimization is desirable when using
pmr::monotonic_buffer_resource. After de-virtualization and inlining it is
likely for node based containers with trivially destructible internal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gar...@ignition-web.co.uk
Target Milestone: ---
void * x;
void test(){ for(void * p = x; p; p=*(void**)p); }
With -O3 gives:
test():
mov rax, QWORD PTR x[rip]
test
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gar...@ignition-web.co.uk
Target Milestone: ---
struct foo
{
foo( foo const & ) = default;
foo( foo const & foo, int )
: foo{ foo }
{}
foo( f