r249046 - in /trunk/gcc: ChangeLog config/rs600...

segher@gcc.gnu.org segher@gcc.gnu.org
Fri Jun 9 03:46:00 GMT 2017


Author: segher
Date: Fri Jun  9 03:46:08 2017
New Revision: 249046

URL: https://gcc.gnu.org/viewcvs?rev=249046&root=gcc&view=rev
Log:
rs6000: Don't add an immediate to r0 (PR80966)

If there is a large stack frame the rs6000 -fstack-limit code would
calculate the new stack pointer value using two insns (an addis and
an addi), with r0 as temporary.  Such instructions do not exist.

This patch changes add<mode>3 to expand using a different strategy in
such cases; to FAIL if there is no way to do it (namely, if the source
is r0 and there is no way to get a temporary reg); and it changes
rs6000_emit_allocate_stack to assert gen_add3_insn did in fact emit
instructions.


	PR target/80966
	* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Assert that
	gen_add3_insn did not fail.
	* config/rs6000/rs6000.md (add<mode>3): If asked to add a constant to
	r0, construct that number in a temporary reg and add that reg to r0.
	If asked to put the result in r0 as well, fail.

gcc/testsuite/
	* gcc.target/powerpc/stack-limit.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.target/powerpc/stack-limit.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/rs6000/rs6000.c
    trunk/gcc/config/rs6000/rs6000.md
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list