* only copy the shiftval field from the original para location when creating

a temporary parameter location if the original location was not a reference
    (because in that case part of the reference overlaps with the shiftval
     variant field, and if we optimise the temp location into a register,
     this register will get a random/bogus shiftval)

git-svn-id: trunk@32599 -
This commit is contained in:
Jonas Maebe 2015-12-05 18:03:59 +00:00
parent e4647ac133
commit 99361994b7

View File

@ -403,7 +403,11 @@ implementation
newparaloc:=cgpara.add_location;
newparaloc^.size:=paraloc^.size;
newparaloc^.def:=paraloc^.def;
newparaloc^.shiftval:=paraloc^.shiftval;
{ shiftval overlaps with part of the reference, so it may be
different from 0 and if wr then force the newparaloc to a register
in the optimization below, shiftval will remain <> 0 }
if not(paraloc^.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
newparaloc^.shiftval:=paraloc^.shiftval;
{ $warning maybe release this optimization for all targets? }
{ released for all CPUs:
i386 isn't affected anyways because it uses the stack to push parameters