From 37e64ce170ecf9ba382e00b2a29dc5f367777e53 Mon Sep 17 00:00:00 2001 From: jonas Date: Mon, 19 Apr 2021 20:52:46 +0000 Subject: --- Merging r49236 into '.': U compiler/aarch64/hlcgcpu.pas A tests/webtbs/tw38766.pp --- Recording mergeinfo for merge of r49236 into '.': U . git-svn-id: https://svn.freepascal.org/svn/fpc/branches/fixes_3_2@49237 3ad0048d-3df7-0310-abae-a5850022a9f2 --- compiler/aarch64/hlcgcpu.pas | 3 ++- tests/webtbs/tw38766.pp | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw38766.pp diff --git a/compiler/aarch64/hlcgcpu.pas b/compiler/aarch64/hlcgcpu.pas index 4fe1e342be..54a94f58fc 100644 --- a/compiler/aarch64/hlcgcpu.pas +++ b/compiler/aarch64/hlcgcpu.pas @@ -212,7 +212,8 @@ implementation if slopt in [SL_SETZERO,SL_SETMAX] then inherited else if not(sreg.bitlen in [32,64]) or - (sreg.startbit<>0) then + (sreg.startbit<>0) or + (getsubreg(fromreg)y then + result:=x + else + result:=y; +end; + +function test: trec; inline; +begin + result.x:=1; + result.y:=2; + result.x:=max(result.x,result.y); +end; + +begin + if test.x<>2 then + halt(1); + if test.y<>2 then + halt(2); +end. -- cgit v1.2.1