]> gcc.gnu.org Git - gcc.git/commit
expand: empty class return optimization [PR88529]
authorJason Merrill <jason@redhat.com>
Sun, 13 Jun 2021 18:00:12 +0000 (14:00 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 21 Jun 2021 14:50:01 +0000 (10:50 -0400)
commit7232f7c4c2d727431096a7ecfcf4ad4db71dcf2a
tree2705e5c36221bf19624c09c493ee9bd193a4cc94
parent12bdd39755a25d237b7776153cbe03e171396fc5
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.
gcc/df-scan.c
gcc/function.c
gcc/testsuite/g++.target/i386/empty-class1.C [new file with mode: 0644]
This page took 0.058493 seconds and 6 git commands to generate.