[PATCH] i386: Cleanup i386/i386elf.h and align it's return convention with the SVR4 ABI

Pat Bernardi bernardi@adacore.com
Tue Aug 18 22:02:30 GMT 2020


As observed a number of years ago in the following thread, i386/i386elf.h has not been kept up to date:

https://gcc.gnu.org/pipermail/gcc/2013-August/209981.html

This patch does the following cleanup:

1. The return convention now follows the i386 and x86_64 SVR4 ABIs again. As discussed in the above thread, the current return convention does not match any other target or existing ABI, which is problematic since the current approach is inefficient (particularly on x86_64-elf) and confuses other tools like GDB (unfortunately that thread did not lead to any fix at the time). 

2. The default version of ASM_OUTPUT_ASCII from elfos.h is used. As mentioned in the cleanup of i386/sysv4.h [1] the ASM_OUTPUT_ASCII implementation then used by sysv4.h, and currently used by i386elf.h, has a significantly higher computation complexity than the default version provided by elfos.h.

The patch has been tested on i386-elf and x86_64-elf hosted on x86_64-linux, fixing a number failing tests that were expecting the SVR4 ABI return convention. It has also been bootstrapped and tested on x86_64-pc-linux-gnu without regression.

If approved, I'll need a maintainer to kindly commit on my behalf.

Thanks,

Pat Bernardi
Senior Software Engineer, AdaCore

[1] https://gcc.gnu.org/pipermail/gcc-patches/2011-February/305559.html

2020-08-18  Pat Bernardi  <bernardi@adacore.com>

gcc/ChangeLog

	* config/i386/i386elf.h (SUBTARGET_RETURN_IN_MEMORY): Remove.
	(ASM_OUTPUT_ASCII): Likewise.
	(DEFAULT_PCC_STRUCT_RETURN): Define.
	* config/i386/i386.c (ix86_return_in_memory): Remove
	SUBTARGET_RETURN_IN_MEMORY.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: i386elf_cleanup.txt
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20200818/fdb5ed1a/attachment.txt>


More information about the Gcc-patches mailing list