https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82899

--- Comment #11 from Antony Polukhin <antoshkka at gmail dot com> ---
Seems perfect https://godbolt.org/g/GX3GQd
The mov is not generated for any constructor and the following code:

extern struct A a;
struct A {
  int m, n;
  A(const A &v);
};

A::A(const A &v) : m(v.m), n((a.m = 1, v.m)) {}

Is not optimized to "A::A(int, const A &v) : m(v.m), n(v.m) { a.m = 1; }"
(which is a mistake).


Are there some tests to make sure that the `mov` won't appear again?

Reply via email to