diff --git a/.gitattributes b/.gitattributes index c67c6f5cdc..f52d49f588 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8105,6 +8105,7 @@ tests/webtbs/tw10966.pp svneol=native#text/plain tests/webtbs/tw1097.pp svneol=native#text/plain tests/webtbs/tw10979.pp svneol=native#text/plain tests/webtbs/tw11006.pp svneol=native#text/plain +tests/webtbs/tw11027.pp svneol=native#text/plain tests/webtbs/tw1103.pp svneol=native#text/plain tests/webtbs/tw1104.pp svneol=native#text/plain tests/webtbs/tw1111.pp svneol=native#text/plain diff --git a/compiler/arm/narmcnv.pas b/compiler/arm/narmcnv.pas index bc8c0349ed..0e0d0b23ff 100644 --- a/compiler/arm/narmcnv.pas +++ b/compiler/arm/narmcnv.pas @@ -190,14 +190,11 @@ implementation if codegenerror then exit; - { bytebool(byte) or wordbool(word) or longbool(longint) must } - { be accepted for var parameters, and must not change the } - { the ordinal value } + { Explicit typecasts from any ordinal type to a boolean type } + { must not change the ordinal value } if (nf_explicit in flags) and (left.resultdef.size=resultdef.size) and - not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) and - is_cbool(resultdef) and - not is_pasbool(left.resultdef) then + not(left.location.loc in [LOC_FLAGS,LOC_JUMP]) then begin location_copy(location,left.location); location.size:=def_cgsize(resultdef); diff --git a/compiler/htypechk.pas b/compiler/htypechk.pas index bebb01915b..0df200c3ba 100644 --- a/compiler/htypechk.pas +++ b/compiler/htypechk.pas @@ -1068,16 +1068,6 @@ implementation CGMessagePos2(hp.fileinfo,type_e_typecast_wrong_size_for_assignment,tostr(fromdef.size),tostr(todef.size)); end; - { when typecasting to the same size but changing the signdness of - an ordinal, the value cannot be in a register if it's < sizeof(aint). - The reason is that a tc_int_2_int type conversion changing the sign - of a such value in a register also has to modify this register (JM) } - if is_ordinal(fromdef) and is_ordinal(todef) and - (fromdef.size=todef.size) and - (fromdef.size