This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, i386]: Fix PR56028, Splitting a 64-bit volatile store


Hello!

Attached patch removes DImode immediate -> memory alternatives from
64bit move patterns. We were lying to a register allocator about this,
and various fixups were needed after reload to split invalid moves.
Split moves to adjacent memory location violated assumption that moves
of arguments of natural width (64bit on x86_64) are atomic.

The patch looks scary, but it is not. It just removes all alternatives
that could produce DImode imm->mem moves on x86_64. Although we try to
avoid duplicate patterns, these are needed for register starved ia32,
where DImode imm->mem moves (later split to SImode moves) help to
avoid spill failures.

We can probably document somewhere the fact, that we now guarantee
atomic DImode moves on x86_64.

2012-01-22  Uros Bizjak  <ubizjak@gmail.com>

	PR target/56028
	* config/i386/i386.md (*movti_internal_rex64): Change (o,riF)
	alternative to (o,r).
	(*movdi_internal_rex64): Remove (!o,n) alternative.
	(DImode immediate->memory splitter): Remove.
	(DImode immediate->memory peephole2): Remove.
	(movtf): Enable for TARGET_64BIT || TARGET_SSE.
	(*movtf_internal_rex64): Rename from *movtf_internal. Change (!o,F*r)
	alternative to (!o,*r).
	(*movtf_internal_sse): New pattern.
	(*movxf_internal_rex64): New pattern.
	(*movxf_internal): Disable for TARGET_64BIT.
	(*movdf_internal_rex64): Remove (!o,F) alternative.

testsuite/ChangeLog:

2012-01-22  Uros Bizjak  <ubizjak@gmail.com>

	PR target/56028
	* gcc.target/i386/pr56028.c: New test.

Patch was bootstrapped and regression tested on x86_64-pc-linux
{,-m32} and was committed to mainline SVN. The patch will be
backported to 4.7 branch after a week without problems in mainline
(and also to be benchmarked for runtime regressions).

Uros.

Attachment: p.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]