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

--- Comment #1 from Antony Polukhin <antoshkka at gmail dot com> ---
Another example:

struct A {
    int i;
    int j;
};

A g();

int test1() {
    A a = g();
    return a.i;
}


GCC-15 produces the following assembly:

test1():
  sub rsp, 8
  call g()
  add rsp, 8
  ret


A more optimal one would be:

test1():
  jmp g()


Godbolt playground: https://godbolt.org/z/sPdxbjPxK

Reply via email to