[Bug c++/88529] New: G++ clears the return register on x86_64 when returning an empty class

rohan at rohanlean dot de gcc-bugzilla@gcc.gnu.org
Mon Dec 17 08:53:00 GMT 2018


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

            Bug ID: 88529
           Summary: G++ clears the return register on x86_64 when
                    returning an empty class
           Product: gcc
           Version: 8.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rohan at rohanlean dot de
  Target Milestone: ---
            Target: x86_64

The following code causes G++ to emit an "xorl %eax, %eax" on x86_64. I believe
the Itanium ABI does not require it, so this is a missed optimisation.

class A{};

A f() { return {}; }


More information about the Gcc-bugs mailing list