Merge commit r42337, to fix avr-embedded packages compilation

------------------------------------------------------------------------
r42337 | laksen | 2019-07-07 14:37:45 +0000 (Sun, 07 Jul 2019) | 1 line

- Fix result type of SizeOf and BitSizeOf to use sizesint instead of sint.
------------------------------------------------------------------------
--- Merging r42337 into '.':
U    compiler/ninl.pas
U    compiler/pexpr.pas
--- Recording mergeinfo for merge of r42337 into '.':
 U   .

git-svn-id: branches/fixes_3_2@43514 -
This commit is contained in:
pierre 2019-11-19 22:28:04 +00:00
parent d27126b64c
commit 1b4fb37948
2 changed files with 10 additions and 10 deletions

View File

@ -2869,13 +2869,13 @@ implementation
if assigned(hightree) then
begin
hp:=caddnode.create(addn,hightree,
cordconstnode.create(1,sinttype,false));
cordconstnode.create(1,sizesinttype,false));
if (left.resultdef.typ=arraydef) then
if not is_packed_array(tarraydef(left.resultdef)) then
begin
if (tarraydef(left.resultdef).elesize<>1) then
hp:=caddnode.create(muln,hp,cordconstnode.create(tarraydef(
left.resultdef).elesize,sinttype,true));
left.resultdef).elesize,sizesinttype,true));
end
else if (tarraydef(left.resultdef).elepackedbitsize <> 8) then
begin
@ -2883,24 +2883,24 @@ implementation
if (hp.nodetype <> ordconstn) then
internalerror(2006081511);
hp.free;
hp := cordconstnode.create(left.resultdef.size,sinttype,true);
hp := cordconstnode.create(left.resultdef.size,sizesinttype,true);
{
hp:=
ctypeconvnode.create_explicit(sinttype,
ctypeconvnode.create_explicit(sizesinttype,
cmoddivnode.create(divn,
caddnode.create(addn,
caddnode.create(muln,hp,cordconstnode.create(tarraydef(
left.resultdef).elepackedbitsize,s64inttype,true)),
cordconstnode.create(a,s64inttype,true)),
cordconstnode.create(8,s64inttype,true)),
sinttype);
sizesinttype);
}
end;
result:=hp;
end;
end
else
resultdef:=sinttype;
resultdef:=sizesinttype;
end;
in_typeof_x:

View File

@ -445,7 +445,7 @@ implementation
statement_syssym:=geninlinenode(in_sizeof_x,false,p1);
{ no packed bit support for these things }
if l=in_bitsizeof_x then
statement_syssym:=caddnode.create(muln,statement_syssym,cordconstnode.create(8,sinttype,true));
statement_syssym:=caddnode.create(muln,statement_syssym,cordconstnode.create(8,sizesinttype,true));
end
else
begin
@ -460,12 +460,12 @@ implementation
not((p1.nodetype = subscriptn) and
is_packed_record_or_object(tsubscriptnode(p1).left.resultdef))) then
begin
statement_syssym:=cordconstnode.create(p1.resultdef.size,sinttype,true);
statement_syssym:=cordconstnode.create(p1.resultdef.size,sizesinttype,true);
if (l = in_bitsizeof_x) then
statement_syssym:=caddnode.create(muln,statement_syssym,cordconstnode.create(8,sinttype,true));
statement_syssym:=caddnode.create(muln,statement_syssym,cordconstnode.create(8,sizesinttype,true));
end
else
statement_syssym:=cordconstnode.create(p1.resultdef.packedbitsize,sinttype,true);
statement_syssym:=cordconstnode.create(p1.resultdef.packedbitsize,sizesinttype,true);
{ p1 not needed !}
p1.destroy;
end;