This is now backported to GCC 10.

Andrew

On 11/09/2020 11:17, Andrew Stubbs wrote:
This patch fixes an execution failure in which the compiler would corrupt TImode values due to missed early clobber problems with partially overlapping register allocations.  In fact, adding early clobber constraints does not fix the issue because IRA doesn't check that for move instructions properly in all circumstances anyway (the constraint causes an ICE in postreload).

This patch fixes the problem by ensuring that TImode values are always aligned to 4-register boundaries, meaning that inputs and outputs will either overlap completely, or not at all, neither of which have early-clobber issues.

This is an artificial restriction the hardware not present in hardware , but it is the same solution we use for DImode values where we had a lot of the same problems.

With the patch I see the following new test passes:

PASS: gfortran.dg/PR95331.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
PASS: gfortran.dg/PR95331.f90   -O3 -g  execution test
PASS: gfortran.dg/gamma_5.f90   -O0  execution test
PASS: gfortran.dg/gamma_5.f90   -O1  execution test
PASS: gfortran.dg/gamma_5.f90   -O2  execution test
PASS: gfortran.dg/gamma_5.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
PASS: gfortran.dg/gamma_5.f90   -O3 -g  execution test
PASS: gfortran.dg/gamma_5.f90   -Os  execution test
PASS: gfortran.dg/intrinsic_pack_1.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
PASS: gfortran.dg/intrinsic_pack_1.f90   -O3 -g  execution test
PASS: gfortran.dg/optional_absent_5.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
PASS: gfortran.dg/optional_absent_5.f90   -O3 -g  execution test

Andrew

Reply via email to