|
@@ -1236,8 +1236,18 @@ unit nx86add;
|
|
|
|
|
|
function tx86addnode.pass_1: tnode;
|
|
function tx86addnode.pass_1: tnode;
|
|
begin
|
|
begin
|
|
|
|
+ { only pass_1 might set the resultdef as it could be set to nil by some previous
|
|
|
|
+ code transformation. As we need a valid left/right.resultdef later on, ensure
|
|
|
|
+ a valid result def is set, see also issue #40727 }
|
|
|
|
+ if not(assigned(left.resultdef)) then
|
|
|
|
+ typecheckpass(left);
|
|
|
|
+ if not(assigned(right.resultdef)) then
|
|
|
|
+ typecheckpass(right);
|
|
|
|
+
|
|
{ on x86, we do not support fpu registers, so in case of operations using the x87, it
|
|
{ on x86, we do not support fpu registers, so in case of operations using the x87, it
|
|
- is normally useful, not to put the operands into registers which would be mm register }
|
|
|
|
|
|
+ is normally useful, not to put the operands into registers which would be mm register
|
|
|
|
+
|
|
|
|
+ this should be called before pass_1 so we have a proper expectloc }
|
|
if ((left.resultdef.typ=floatdef) or (right.resultdef.typ=floatdef)) and
|
|
if ((left.resultdef.typ=floatdef) or (right.resultdef.typ=floatdef)) and
|
|
(not(use_vectorfpu(left.resultdef)) and not(use_vectorfpu(right.resultdef)) and
|
|
(not(use_vectorfpu(left.resultdef)) and not(use_vectorfpu(right.resultdef)) and
|
|
not(use_vectorfpu(resultdef))) then
|
|
not(use_vectorfpu(resultdef))) then
|