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

2021-06-21 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88529

Jason Merrill  changed:

   What|Removed |Added

   Target Milestone|--- |12.0
 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #7 from Jason Merrill  ---
Fixed for GCC 12.

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

2021-06-21 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88529

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:7232f7c4c2d727431096a7ecfcf4ad4db71dcf2a

commit r12-1702-g7232f7c4c2d727431096a7ecfcf4ad4db71dcf2a
Author: Jason Merrill 
Date:   Sun Jun 13 14:00:12 2021 -0400

expand: empty class return optimization [PR88529]

The x86_64 psABI says that an empty class isn't passed or returned in
memory
or registers, so we shouldn't set %eax in this function.

The df-scan hunk catches the case where we look at a 0-length reg and build
a range the length of unsigned int, which happened before I changed
assign_parms to match expand_function_end.

PR target/88529

gcc/ChangeLog:

* df-scan.c (df_ref_record): Check that regno < endregno.
* function.c (assign_parms, expand_function_end): Do nothing with a
TYPE_EMPTY_P result.

gcc/testsuite/ChangeLog:

* g++.target/i386/empty-class1.C: New test.

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

2021-06-13 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88529

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

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

2019-06-19 Thread antoshkka at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88529

--- Comment #5 from Antony Polukhin  ---
(In reply to Jason Merrill from comment #1)
> Created attachment 45899 [details]
> Fix

Is it enough to test only for `scan-assembler-not mov`? Probably a
`scan-assembler-not xor` should be also added?

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

2019-03-25 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88529

--- Comment #4 from Andrew Pinski  ---
related to PR20408 (but not the same as the patch which Jason attached is
different)

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

2019-03-25 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88529

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-03-25
 Ever confirmed|0   |1
   Severity|normal  |enhancement

--- Comment #3 from Andrew Pinski  ---
There might be another bug that talks about this similar thing.
Confirmed.

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

2019-03-25 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88529

Andrew Pinski  changed:

   What|Removed |Added

 CC||antoshkka at gmail dot com

--- Comment #2 from Andrew Pinski  ---
*** Bug 89820 has been marked as a duplicate of this bug. ***

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

2019-03-05 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88529

Jason Merrill  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #1 from Jason Merrill  ---
Created attachment 45899
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45899=edit
Fix

Here's a fix.  I'm not sure if it's suitable for GCC 9 or 10.