Browse Source

+ initial support for pascal booleans with sizes 2, 4 and 8

git-svn-id: branches/pasboolxx@17836 -
florian 14 năm trước cách đây
mục cha
commit
d35d1ed357

+ 37 - 2
compiler/dbgdwarf.pas

@@ -1418,8 +1418,7 @@ implementation
                 ]);
                 ]);
               finish_entry;
               finish_entry;
             end;
             end;
-          pasbool,
-          bool8bit :
+          pasbool8 :
             begin
             begin
               append_entry(DW_TAG_base_type,false,[
               append_entry(DW_TAG_base_type,false,[
                 DW_AT_name,DW_FORM_string,'Boolean'#0,
                 DW_AT_name,DW_FORM_string,'Boolean'#0,
@@ -1428,6 +1427,24 @@ implementation
                 ]);
                 ]);
               finish_entry;
               finish_entry;
             end;
             end;
+          bool8bit :
+            begin
+              append_entry(DW_TAG_base_type,false,[
+                DW_AT_name,DW_FORM_string,'ByteBool'#0,
+                DW_AT_encoding,DW_FORM_data1,DW_ATE_boolean,
+                DW_AT_byte_size,DW_FORM_data1,1
+                ]);
+              finish_entry;
+            end;
+          pasbool16 :
+            begin
+              append_entry(DW_TAG_base_type,false,[
+                DW_AT_name,DW_FORM_string,'Boolean16'#0,
+                DW_AT_encoding,DW_FORM_data1,DW_ATE_boolean,
+                DW_AT_byte_size,DW_FORM_data1,2
+                ]);
+              finish_entry;
+            end;
           bool16bit :
           bool16bit :
             begin
             begin
               append_entry(DW_TAG_base_type,false,[
               append_entry(DW_TAG_base_type,false,[
@@ -1437,6 +1454,15 @@ implementation
                 ]);
                 ]);
               finish_entry;
               finish_entry;
             end;
             end;
+          pasbool32 :
+            begin
+              append_entry(DW_TAG_base_type,false,[
+                DW_AT_name,DW_FORM_string,'Boolean32'#0,
+                DW_AT_encoding,DW_FORM_data1,DW_ATE_boolean,
+                DW_AT_byte_size,DW_FORM_data1,4
+                ]);
+              finish_entry;
+            end;
           bool32bit :
           bool32bit :
             begin
             begin
               append_entry(DW_TAG_base_type,false,[
               append_entry(DW_TAG_base_type,false,[
@@ -1446,6 +1472,15 @@ implementation
                 ]);
                 ]);
               finish_entry;
               finish_entry;
             end;
             end;
+          pasbool64 :
+            begin
+              append_entry(DW_TAG_base_type,false,[
+                DW_AT_name,DW_FORM_string,'Boolean64'#0,
+                DW_AT_encoding,DW_FORM_data1,DW_ATE_boolean,
+                DW_AT_byte_size,DW_FORM_data1,8
+                ]);
+              finish_entry;
+            end;
           bool64bit :
           bool64bit :
             begin
             begin
               append_entry(DW_TAG_base_type,false,[
               append_entry(DW_TAG_base_type,false,[

+ 8 - 2
compiler/dbgstabs.pas

@@ -624,7 +624,10 @@ implementation
             case def.ordtype of
             case def.ordtype of
               uvoid :
               uvoid :
                 ss:=def_stab_number(def);
                 ss:=def_stab_number(def);
-              pasbool,
+              pasbool8,
+              pasbool16,
+              pasbool32,
+              pasbool64,
               bool8bit,
               bool8bit,
               bool16bit,
               bool16bit,
               bool32bit,
               bool32bit,
@@ -647,13 +650,16 @@ implementation
                 ss:='-20;';
                 ss:='-20;';
               uwidechar :
               uwidechar :
                 ss:='-30;';
                 ss:='-30;';
-              pasbool,
+              pasbool8,
               bool8bit :
               bool8bit :
                 ss:='-21;';
                 ss:='-21;';
+              pasbool16,
               bool16bit :
               bool16bit :
                 ss:='-22;';
                 ss:='-22;';
+              pasbool32,
               bool32bit :
               bool32bit :
                 ss:='-23;';
                 ss:='-23;';
+              pasbool64,
               bool64bit :
               bool64bit :
                 { no clue if this is correct (FK) }
                 { no clue if this is correct (FK) }
                 ss:='-23;';
                 ss:='-23;';

+ 7 - 4
compiler/defcmp.pas

@@ -166,7 +166,8 @@ implementation
           (bvoid,
           (bvoid,
            bint,bint,bint,bint,
            bint,bint,bint,bint,
            bint,bint,bint,bint,
            bint,bint,bint,bint,
-           bbool,bbool,bbool,bbool,bbool,
+           bbool,bbool,bbool,bbool,
+           bbool,bbool,bbool,bbool,
            bchar,bchar,bint);
            bchar,bchar,bint);
 
 
         basedefconvertsimplicit : array[tbasedef,tbasedef] of tconverttype =
         basedefconvertsimplicit : array[tbasedef,tbasedef] of tconverttype =
@@ -241,7 +242,8 @@ implementation
                                 end;
                                 end;
                             end;
                             end;
                           uvoid,
                           uvoid,
-                          pasbool,bool8bit,bool16bit,bool32bit,bool64bit:
+                          pasbool8,pasbool16,pasbool32,pasbool64,
+                          bool8bit,bool16bit,bool32bit,bool64bit:
                             eq:=te_equal;
                             eq:=te_equal;
                           else
                           else
                             internalerror(200210061);
                             internalerror(200210061);
@@ -1551,8 +1553,9 @@ implementation
                 u8bit,u16bit,u32bit,u64bit,
                 u8bit,u16bit,u32bit,u64bit,
                 s8bit,s16bit,s32bit,s64bit :
                 s8bit,s16bit,s32bit,s64bit :
                   is_subequal:=(torddef(def2).ordtype in [s64bit,u64bit,s32bit,u32bit,u8bit,s8bit,s16bit,u16bit]);
                   is_subequal:=(torddef(def2).ordtype in [s64bit,u64bit,s32bit,u32bit,u8bit,s8bit,s16bit,u16bit]);
-                pasbool,bool8bit,bool16bit,bool32bit,bool64bit :
-                  is_subequal:=(torddef(def2).ordtype in [pasbool,bool8bit,bool16bit,bool32bit,bool64bit]);
+                pasbool8,pasbool16,pasbool32,pasbool64,
+                bool8bit,bool16bit,bool32bit,bool64bit :
+                  is_subequal:=(torddef(def2).ordtype in [pasbool8,pasbool16,pasbool32,pasbool64,bool8bit,bool16bit,bool32bit,bool64bit]);
                 uchar :
                 uchar :
                   is_subequal:=(torddef(def2).ordtype=uchar);
                   is_subequal:=(torddef(def2).ordtype=uchar);
                 uwidechar :
                 uwidechar :

+ 4 - 3
compiler/defutil.pas

@@ -387,7 +387,8 @@ implementation
                is_ordinal:=dt in [uchar,uwidechar,
                is_ordinal:=dt in [uchar,uwidechar,
                                   u8bit,u16bit,u32bit,u64bit,
                                   u8bit,u16bit,u32bit,u64bit,
                                   s8bit,s16bit,s32bit,s64bit,
                                   s8bit,s16bit,s32bit,s64bit,
-                                  pasbool,bool8bit,bool16bit,bool32bit,bool64bit];
+                                  pasbool8,pasbool16,pasbool32,pasbool64,
+                                  bool8bit,bool16bit,bool32bit,bool64bit];
              end;
              end;
            enumdef :
            enumdef :
              is_ordinal:=true;
              is_ordinal:=true;
@@ -444,14 +445,14 @@ implementation
     function is_boolean(def : tdef) : boolean;
     function is_boolean(def : tdef) : boolean;
       begin
       begin
         result:=(def.typ=orddef) and
         result:=(def.typ=orddef) and
-                    (torddef(def).ordtype in [pasbool,bool8bit,bool16bit,bool32bit,bool64bit]);
+                    (torddef(def).ordtype in [pasbool8,pasbool16,pasbool32,pasbool64,bool8bit,bool16bit,bool32bit,bool64bit]);
       end;
       end;
 
 
 
 
     function is_pasbool(def : tdef) : boolean;
     function is_pasbool(def : tdef) : boolean;
       begin
       begin
         result:=(def.typ=orddef) and
         result:=(def.typ=orddef) and
-                    (torddef(def).ordtype = pasbool);
+                    (torddef(def).ordtype in [pasbool8,pasbool16,pasbool32,pasbool64]);
       end;
       end;
 
 
     { true if def is a C-style boolean (non-zero value = true, zero = false) }
     { true if def is a C-style boolean (non-zero value = true, zero = false) }

+ 2 - 1
compiler/htypechk.pas

@@ -2477,7 +2477,8 @@ implementation
         variantorddef_cl: array[tordtype] of tvariantequaltype =
         variantorddef_cl: array[tordtype] of tvariantequaltype =
           (tve_incompatible,tve_byte,tve_word,tve_cardinal,tve_chari64,
           (tve_incompatible,tve_byte,tve_word,tve_cardinal,tve_chari64,
            tve_shortint,tve_smallint,tve_longint,tve_chari64,
            tve_shortint,tve_smallint,tve_longint,tve_chari64,
-           tve_boolformal,tve_boolformal,tve_boolformal,tve_boolformal,tve_boolformal,
+           tve_boolformal,tve_boolformal,tve_boolformal,tve_boolformal,
+           tve_boolformal,tve_boolformal,tve_boolformal,tve_boolformal,
            tve_chari64,tve_chari64,tve_dblcurrency);
            tve_chari64,tve_chari64,tve_dblcurrency);
 { TODO: fixme for 128 bit floats }
 { TODO: fixme for 128 bit floats }
         variantfloatdef_cl: array[tfloattype] of tvariantequaltype =
         variantfloatdef_cl: array[tfloattype] of tvariantequaltype =

+ 54 - 54
compiler/nadd.pas

@@ -334,17 +334,17 @@ implementation
                  else
                  else
                    t:=cordconstnode.create(lv and rv,resultdef,true);
                    t:=cordconstnode.create(lv and rv,resultdef,true);
                ltn :
                ltn :
-                 t:=cordconstnode.create(ord(lv<rv),booltype,true);
+                 t:=cordconstnode.create(ord(lv<rv),pasbool8type,true);
                lten :
                lten :
-                 t:=cordconstnode.create(ord(lv<=rv),booltype,true);
+                 t:=cordconstnode.create(ord(lv<=rv),pasbool8type,true);
                gtn :
                gtn :
-                 t:=cordconstnode.create(ord(lv>rv),booltype,true);
+                 t:=cordconstnode.create(ord(lv>rv),pasbool8type,true);
                gten :
                gten :
-                 t:=cordconstnode.create(ord(lv>=rv),booltype,true);
+                 t:=cordconstnode.create(ord(lv>=rv),pasbool8type,true);
                equaln :
                equaln :
-                 t:=cordconstnode.create(ord(lv=rv),booltype,true);
+                 t:=cordconstnode.create(ord(lv=rv),pasbool8type,true);
                unequaln :
                unequaln :
-                 t:=cordconstnode.create(ord(lv<>rv),booltype,true);
+                 t:=cordconstnode.create(ord(lv<>rv),pasbool8type,true);
                slashn :
                slashn :
                  begin
                  begin
                    { int/int becomes a real }
                    { int/int becomes a real }
@@ -387,30 +387,30 @@ implementation
                 case nodetype of
                 case nodetype of
                  ltn:
                  ltn:
                    if lv<low then
                    if lv<low then
-                     t:=Cordconstnode.create(1,booltype,true)
+                     t:=Cordconstnode.create(1,pasbool8type,true)
                    else if lv>=high then
                    else if lv>=high then
-                     t:=Cordconstnode.create(0,booltype,true);
+                     t:=Cordconstnode.create(0,pasbool8type,true);
                  lten:
                  lten:
                    if lv<=low then
                    if lv<=low then
-                     t:=Cordconstnode.create(1,booltype,true)
+                     t:=Cordconstnode.create(1,pasbool8type,true)
                    else if lv>high then
                    else if lv>high then
-                     t:=Cordconstnode.create(0,booltype,true);
+                     t:=Cordconstnode.create(0,pasbool8type,true);
                  gtn:
                  gtn:
                    if lv<=low then
                    if lv<=low then
-                     t:=Cordconstnode.create(0,booltype,true)
+                     t:=Cordconstnode.create(0,pasbool8type,true)
                    else if lv>high then
                    else if lv>high then
-                     t:=Cordconstnode.create(1,booltype,true);
+                     t:=Cordconstnode.create(1,pasbool8type,true);
                  gten :
                  gten :
                    if lv<low then
                    if lv<low then
-                     t:=Cordconstnode.create(0,booltype,true)
+                     t:=Cordconstnode.create(0,pasbool8type,true)
                    else if lv>=high then
                    else if lv>=high then
-                     t:=Cordconstnode.create(1,booltype,true);
+                     t:=Cordconstnode.create(1,pasbool8type,true);
                  equaln:
                  equaln:
                    if (lv<low) or (lv>high) then
                    if (lv<low) or (lv>high) then
-                     t:=Cordconstnode.create(0,booltype,true);
+                     t:=Cordconstnode.create(0,pasbool8type,true);
                  unequaln:
                  unequaln:
                    if (lv<low) or (lv>high) then
                    if (lv<low) or (lv>high) then
-                     t:=Cordconstnode.create(1,booltype,true);
+                     t:=Cordconstnode.create(1,pasbool8type,true);
                 end;
                 end;
               if t<>nil then
               if t<>nil then
                 begin
                 begin
@@ -436,30 +436,30 @@ implementation
                 case nodetype of
                 case nodetype of
                  ltn:
                  ltn:
                    if high<rv then
                    if high<rv then
-                     t:=Cordconstnode.create(1,booltype,true)
+                     t:=Cordconstnode.create(1,pasbool8type,true)
                    else if low>=rv then
                    else if low>=rv then
-                     t:=Cordconstnode.create(0,booltype,true);
+                     t:=Cordconstnode.create(0,pasbool8type,true);
                  lten:
                  lten:
                    if high<=rv then
                    if high<=rv then
-                     t:=Cordconstnode.create(1,booltype,true)
+                     t:=Cordconstnode.create(1,pasbool8type,true)
                    else if low>rv then
                    else if low>rv then
-                     t:=Cordconstnode.create(0,booltype,true);
+                     t:=Cordconstnode.create(0,pasbool8type,true);
                  gtn:
                  gtn:
                    if high<=rv then
                    if high<=rv then
-                     t:=Cordconstnode.create(0,booltype,true)
+                     t:=Cordconstnode.create(0,pasbool8type,true)
                    else if low>rv then
                    else if low>rv then
-                     t:=Cordconstnode.create(1,booltype,true);
+                     t:=Cordconstnode.create(1,pasbool8type,true);
                  gten:
                  gten:
                    if high<rv then
                    if high<rv then
-                     t:=Cordconstnode.create(0,booltype,true)
+                     t:=Cordconstnode.create(0,pasbool8type,true)
                    else if low>=rv then
                    else if low>=rv then
-                     t:=Cordconstnode.create(1,booltype,true);
+                     t:=Cordconstnode.create(1,pasbool8type,true);
                  equaln:
                  equaln:
                    if (rv<low) or (rv>high) then
                    if (rv<low) or (rv>high) then
-                     t:=Cordconstnode.create(0,booltype,true);
+                     t:=Cordconstnode.create(0,pasbool8type,true);
                  unequaln:
                  unequaln:
                    if (rv<low) or (rv>high) then
                    if (rv<low) or (rv>high) then
-                     t:=Cordconstnode.create(1,booltype,true);
+                     t:=Cordconstnode.create(1,pasbool8type,true);
                 end;
                 end;
               if t<>nil then
               if t<>nil then
                 begin
                 begin
@@ -563,17 +563,17 @@ implementation
                 slashn :
                 slashn :
                   t:=crealconstnode.create(lvd/rvd,resultrealdef);
                   t:=crealconstnode.create(lvd/rvd,resultrealdef);
                 ltn :
                 ltn :
-                  t:=cordconstnode.create(ord(lvd<rvd),booltype,true);
+                  t:=cordconstnode.create(ord(lvd<rvd),pasbool8type,true);
                 lten :
                 lten :
-                  t:=cordconstnode.create(ord(lvd<=rvd),booltype,true);
+                  t:=cordconstnode.create(ord(lvd<=rvd),pasbool8type,true);
                 gtn :
                 gtn :
-                  t:=cordconstnode.create(ord(lvd>rvd),booltype,true);
+                  t:=cordconstnode.create(ord(lvd>rvd),pasbool8type,true);
                 gten :
                 gten :
-                  t:=cordconstnode.create(ord(lvd>=rvd),booltype,true);
+                  t:=cordconstnode.create(ord(lvd>=rvd),pasbool8type,true);
                 equaln :
                 equaln :
-                  t:=cordconstnode.create(ord(lvd=rvd),booltype,true);
+                  t:=cordconstnode.create(ord(lvd=rvd),pasbool8type,true);
                 unequaln :
                 unequaln :
-                  t:=cordconstnode.create(ord(lvd<>rvd),booltype,true);
+                  t:=cordconstnode.create(ord(lvd<>rvd),pasbool8type,true);
                 else
                 else
                   internalerror(2008022102);
                   internalerror(2008022102);
              end;
              end;
@@ -602,17 +602,17 @@ implementation
                      t:=cstringconstnode.createwstr(ws1);
                      t:=cstringconstnode.createwstr(ws1);
                   end;
                   end;
                 ltn :
                 ltn :
-                  t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<0),booltype,true);
+                  t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<0),pasbool8type,true);
                 lten :
                 lten :
-                  t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<=0),booltype,true);
+                  t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<=0),pasbool8type,true);
                 gtn :
                 gtn :
-                  t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)>0),booltype,true);
+                  t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)>0),pasbool8type,true);
                 gten :
                 gten :
-                  t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)>=0),booltype,true);
+                  t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)>=0),pasbool8type,true);
                 equaln :
                 equaln :
-                  t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)=0),booltype,true);
+                  t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)=0),pasbool8type,true);
                 unequaln :
                 unequaln :
-                  t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<>0),booltype,true);
+                  t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<>0),pasbool8type,true);
                 else
                 else
                   internalerror(2008022103);
                   internalerror(2008022103);
              end;
              end;
@@ -676,17 +676,17 @@ implementation
                     tstringconstnode(t).changestringtype(resultdef);
                     tstringconstnode(t).changestringtype(resultdef);
                   end;
                   end;
                 ltn :
                 ltn :
-                  t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)<0),booltype,true);
+                  t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)<0),pasbool8type,true);
                 lten :
                 lten :
-                  t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)<=0),booltype,true);
+                  t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)<=0),pasbool8type,true);
                 gtn :
                 gtn :
-                  t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)>0),booltype,true);
+                  t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)>0),pasbool8type,true);
                 gten :
                 gten :
-                  t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)>=0),booltype,true);
+                  t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)>=0),pasbool8type,true);
                 equaln :
                 equaln :
-                  t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)=0),booltype,true);
+                  t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)=0),pasbool8type,true);
                 unequaln :
                 unequaln :
-                  t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)<>0),booltype,true);
+                  t:=cordconstnode.create(byte(compareansistrings(s1,s2,l1,l2)<>0),pasbool8type,true);
                 else
                 else
                   internalerror(2008022104);
                   internalerror(2008022104);
              end;
              end;
@@ -724,22 +724,22 @@ implementation
                unequaln :
                unequaln :
                   begin
                   begin
                     b:=tsetconstnode(right).value_set^ <> tsetconstnode(left).value_set^;
                     b:=tsetconstnode(right).value_set^ <> tsetconstnode(left).value_set^;
-                    t:=cordconstnode.create(byte(b),booltype,true);
+                    t:=cordconstnode.create(byte(b),pasbool8type,true);
                   end;
                   end;
                equaln :
                equaln :
                   begin
                   begin
                     b:=tsetconstnode(right).value_set^ = tsetconstnode(left).value_set^;
                     b:=tsetconstnode(right).value_set^ = tsetconstnode(left).value_set^;
-                    t:=cordconstnode.create(byte(b),booltype,true);
+                    t:=cordconstnode.create(byte(b),pasbool8type,true);
                   end;
                   end;
                lten :
                lten :
                   begin
                   begin
                     b:=tsetconstnode(left).value_set^ <= tsetconstnode(right).value_set^;
                     b:=tsetconstnode(left).value_set^ <= tsetconstnode(right).value_set^;
-                    t:=cordconstnode.create(byte(b),booltype,true);
+                    t:=cordconstnode.create(byte(b),pasbool8type,true);
                   end;
                   end;
                gten :
                gten :
                   begin
                   begin
                     b:=tsetconstnode(left).value_set^ >= tsetconstnode(right).value_set^;
                     b:=tsetconstnode(left).value_set^ >= tsetconstnode(right).value_set^;
-                    t:=cordconstnode.create(byte(b),booltype,true);
+                    t:=cordconstnode.create(byte(b),pasbool8type,true);
                   end;
                   end;
                 else
                 else
                   internalerror(2008022105);
                   internalerror(2008022105);
@@ -1027,12 +1027,12 @@ implementation
                 begin
                 begin
                   if not is_boolean(ld) then
                   if not is_boolean(ld) then
                     begin
                     begin
-                      inserttypeconv(left,booltype);
+                      inserttypeconv(left,pasbool8type);
                       ld := left.resultdef;
                       ld := left.resultdef;
                     end;
                     end;
                   if not is_boolean(rd) then
                   if not is_boolean(rd) then
                     begin
                     begin
-                      inserttypeconv(right,booltype);
+                      inserttypeconv(right,pasbool8type);
                       rd := right.resultdef;
                       rd := right.resultdef;
                     end;
                     end;
                 end;
                 end;
@@ -1857,7 +1857,7 @@ implementation
           begin
           begin
              case nodetype of
              case nodetype of
                 ltn,lten,gtn,gten,equaln,unequaln :
                 ltn,lten,gtn,gten,equaln,unequaln :
-                  resultdef:=booltype;
+                  resultdef:=pasbool8type;
                 slashn :
                 slashn :
                   resultdef:=resultrealdef;
                   resultdef:=resultrealdef;
                 addn:
                 addn:
@@ -2327,7 +2327,7 @@ implementation
 
 
         { otherwise, create the parameters for the helper }
         { otherwise, create the parameters for the helper }
         right := ccallparanode.create(
         right := ccallparanode.create(
-          cordconstnode.create(ord(cs_check_overflow in current_settings.localswitches),booltype,true),
+          cordconstnode.create(ord(cs_check_overflow in current_settings.localswitches),pasbool8type,true),
           ccallparanode.create(right,ccallparanode.create(left,nil)));
           ccallparanode.create(right,ccallparanode.create(left,nil)));
         left := nil;
         left := nil;
         { only qword needs the unsigned code, the
         { only qword needs the unsigned code, the
@@ -2457,7 +2457,7 @@ implementation
         if not(target_info.system in systems_wince) then
         if not(target_info.system in systems_wince) then
           begin
           begin
             if nodetype in [ltn,lten,gtn,gten,equaln,unequaln] then
             if nodetype in [ltn,lten,gtn,gten,equaln,unequaln] then
-              resultdef:=booltype;
+              resultdef:=pasbool8type;
             result:=ctypeconvnode.create_internal(ccallnode.createintern(procname,ccallparanode.create(
             result:=ctypeconvnode.create_internal(ccallnode.createintern(procname,ccallparanode.create(
                 ctypeconvnode.create_internal(right,fdef),
                 ctypeconvnode.create_internal(right,fdef),
                 ccallparanode.create(
                 ccallparanode.create(
@@ -2618,7 +2618,7 @@ implementation
                          internalerror(2011022301);
                          internalerror(2011022301);
                      end;
                      end;
                      result := ccallnode.createintern(procname,
                      result := ccallnode.createintern(procname,
-                       ccallparanode.create(cordconstnode.create(0,booltype,false),
+                       ccallparanode.create(cordconstnode.create(0,pasbool8type,false),
                        ccallparanode.create(right,
                        ccallparanode.create(right,
                        ccallparanode.create(left,nil))));
                        ccallparanode.create(left,nil))));
                      left := nil;
                      left := nil;

+ 2 - 2
compiler/ncal.pas

@@ -2340,12 +2340,12 @@ implementation
                 else
                 else
                  if vo_is_range_check in para.parasym.varoptions then
                  if vo_is_range_check in para.parasym.varoptions then
                    begin
                    begin
-                     para.left:=cordconstnode.create(Ord(cs_check_range in current_settings.localswitches),booltype,false);
+                     para.left:=cordconstnode.create(Ord(cs_check_range in current_settings.localswitches),pasbool8type,false);
                    end
                    end
                 else
                 else
                  if vo_is_overflow_check in para.parasym.varoptions then
                  if vo_is_overflow_check in para.parasym.varoptions then
                    begin
                    begin
-                     para.left:=cordconstnode.create(Ord(cs_check_overflow in current_settings.localswitches),booltype,false);
+                     para.left:=cordconstnode.create(Ord(cs_check_overflow in current_settings.localswitches),pasbool8type,false);
                    end
                    end
                 else
                 else
                   if vo_is_msgsel in para.parasym.varoptions then
                   if vo_is_msgsel in para.parasym.varoptions then

+ 8 - 7
compiler/ncgrtti.pas

@@ -452,7 +452,7 @@ implementation
           end;
           end;
           { we need to align by Tconstptruint here to satisfy the alignment rules set by
           { we need to align by Tconstptruint here to satisfy the alignment rules set by
             records: in the typinfo unit we overlay a TTypeData record on this data, which at
             records: in the typinfo unit we overlay a TTypeData record on this data, which at
-            the innermost variant record needs an alignment of TConstPtrUint due to e.g. 
+            the innermost variant record needs an alignment of TConstPtrUint due to e.g.
             the "CompType" member for tkSet (also the "BaseType" member for tkEnumeration).
             the "CompType" member for tkSet (also the "BaseType" member for tkEnumeration).
             We need to adhere to this, otherwise things will break.
             We need to adhere to this, otherwise things will break.
             Note that other code (e.g. enumdef_rtti_calcstringtablestart()) relies on the
             Note that other code (e.g. enumdef_rtti_calcstringtablestart()) relies on the
@@ -490,7 +490,8 @@ implementation
               (otUByte{otNone},
               (otUByte{otNone},
                otUByte,otUWord,otULong,otUByte{otNone},
                otUByte,otUWord,otULong,otUByte{otNone},
                otSByte,otSWord,otSLong,otUByte{otNone},
                otSByte,otSWord,otSLong,otUByte{otNone},
-               otUByte,otSByte,otSWord,otSLong,otSByte,
+               otUByte,otUWord,otULong,otUByte,
+               otSByte,otSWord,otSLong,otSByte,
                otUByte,otUWord,otUByte);
                otUByte,otUWord,otUByte);
           begin
           begin
             write_header(def,typekind);
             write_header(def,typekind);
@@ -523,7 +524,7 @@ implementation
                 { high }
                 { high }
                 current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_64bit(def.high.svalue));
                 current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_64bit(def.high.svalue));
               end;
               end;
-            pasbool:
+            pasbool8:
                 dointeger(tkBool);
                 dointeger(tkBool);
             uchar:
             uchar:
                 dointeger(tkChar);
                 dointeger(tkChar);
@@ -698,18 +699,18 @@ implementation
                  potype_class_constructor: methodkind:=mkClassConstructor;
                  potype_class_constructor: methodkind:=mkClassConstructor;
                  potype_class_destructor: methodkind:=mkClassDestructor;
                  potype_class_destructor: methodkind:=mkClassDestructor;
                  potype_operator: methodkind:=mkOperatorOverload;
                  potype_operator: methodkind:=mkOperatorOverload;
-                 potype_procedure: 
-                   if po_classmethod in def.procoptions then 
+                 potype_procedure:
+                   if po_classmethod in def.procoptions then
                      methodkind:=mkClassProcedure
                      methodkind:=mkClassProcedure
                    else
                    else
                      methodkind:=mkProcedure;
                      methodkind:=mkProcedure;
                  potype_function:
                  potype_function:
-                   if po_classmethod in def.procoptions then 
+                   if po_classmethod in def.procoptions then
                      methodkind:=mkClassFunction
                      methodkind:=mkClassFunction
                    else
                    else
                      methodkind:=mkFunction;
                      methodkind:=mkFunction;
                else
                else
-                 begin                   
+                 begin
                    if def.returndef = voidtype then
                    if def.returndef = voidtype then
                      methodkind:=mkProcedure
                      methodkind:=mkProcedure
                    else
                    else

+ 4 - 4
compiler/ncnv.pas

@@ -913,7 +913,7 @@ implementation
             addstatement(newstat,restemp);
             addstatement(newstat,restemp);
             addstatement(newstat,ccallnode.createintern('fpc_'+chartype+'array_to_shortstr',
             addstatement(newstat,ccallnode.createintern('fpc_'+chartype+'array_to_shortstr',
               ccallparanode.create(cordconstnode.create(
               ccallparanode.create(cordconstnode.create(
-                ord(tarraydef(left.resultdef).lowrange=0),booltype,false),
+                ord(tarraydef(left.resultdef).lowrange=0),pasbool8type,false),
               ccallparanode.create(left,ccallparanode.create(
               ccallparanode.create(left,ccallparanode.create(
               ctemprefnode.create(restemp),nil)))));
               ctemprefnode.create(restemp),nil)))));
             addstatement(newstat,ctempdeletenode.create_normal_temp(restemp));
             addstatement(newstat,ctempdeletenode.create_normal_temp(restemp));
@@ -924,7 +924,7 @@ implementation
           result:=ccallnode.createinternres(
           result:=ccallnode.createinternres(
             'fpc_'+chartype+'array_to_'+tstringdef(resultdef).stringtypname,
             'fpc_'+chartype+'array_to_'+tstringdef(resultdef).stringtypname,
             ccallparanode.create(cordconstnode.create(
             ccallparanode.create(cordconstnode.create(
-               ord(tarraydef(left.resultdef).lowrange=0),booltype,false),
+               ord(tarraydef(left.resultdef).lowrange=0),pasbool8type,false),
              ccallparanode.create(left,nil)),resultdef);
              ccallparanode.create(left,nil)),resultdef);
         left:=nil;
         left:=nil;
       end;
       end;
@@ -3347,7 +3347,7 @@ implementation
               CGMessage1(type_e_class_or_cominterface_type_expected,left.resultdef.typename);
               CGMessage1(type_e_class_or_cominterface_type_expected,left.resultdef.typename);
             case nodetype of
             case nodetype of
               isn:
               isn:
-                resultdef:=booltype;
+                resultdef:=pasbool8type;
               asn:
               asn:
                 resultdef:=tclassrefdef(right.resultdef).pointeddef;
                 resultdef:=tclassrefdef(right.resultdef).pointeddef;
             end;
             end;
@@ -3361,7 +3361,7 @@ implementation
 
 
             case nodetype of
             case nodetype of
               isn:
               isn:
-                resultdef:=booltype;
+                resultdef:=pasbool8type;
               asn:
               asn:
                 resultdef:=right.resultdef;
                 resultdef:=right.resultdef;
             end;
             end;

+ 4 - 4
compiler/nflw.pas

@@ -457,7 +457,7 @@ implementation
           one }
           one }
         hp:=cwhilerepeatnode.create(
         hp:=cwhilerepeatnode.create(
           { repeat .. until false }
           { repeat .. until false }
-          cordconstnode.create(0,booltype,false),innerloop,false,true);
+          cordconstnode.create(0,pasbool8type,false),innerloop,false,true);
         addstatement(outerloopbodystatement,hp);
         addstatement(outerloopbodystatement,hp);
 
 
         { create the outer repeat/until and add it to the the main body }
         { create the outer repeat/until and add it to the the main body }
@@ -1074,7 +1074,7 @@ implementation
            not(is_typeparam(left.resultdef)) then
            not(is_typeparam(left.resultdef)) then
            begin
            begin
              if left.resultdef.typ=variantdef then
              if left.resultdef.typ=variantdef then
-               inserttypeconv(left,booltype)
+               inserttypeconv(left,pasbool8type)
              else
              else
                CGMessage1(type_e_boolean_expr_expected,left.resultdef.typename);
                CGMessage1(type_e_boolean_expr_expected,left.resultdef.typename);
            end;
            end;
@@ -1311,7 +1311,7 @@ implementation
             end;
             end;
         if not is_constboolnode(condition) then
         if not is_constboolnode(condition) then
             aktstate.store_fact(condition,
             aktstate.store_fact(condition,
-             cordconstnode.create(byte(checknegate),booltype,true))
+             cordconstnode.create(byte(checknegate),pasbool8type,true))
         else
         else
             condition.destroy;
             condition.destroy;
     end;
     end;
@@ -1387,7 +1387,7 @@ implementation
            not(is_typeparam(left.resultdef)) then
            not(is_typeparam(left.resultdef)) then
            begin
            begin
              if left.resultdef.typ=variantdef then
              if left.resultdef.typ=variantdef then
-               inserttypeconv(left,booltype)
+               inserttypeconv(left,pasbool8type)
              else
              else
                Message1(type_e_boolean_expr_expected,left.resultdef.typename);
                Message1(type_e_boolean_expr_expected,left.resultdef.typename);
            end;
            end;

+ 24 - 7
compiler/ninl.pas

@@ -314,7 +314,8 @@ implementation
             scurrency,
             scurrency,
             s64bit:
             s64bit:
               procname := procname + 'int64';
               procname := procname + 'int64';
-            pasbool,bool8bit,bool16bit,bool32bit,bool64bit:
+            pasbool8,pasbool16,pasbool32,pasbool64,
+            bool8bit,bool16bit,bool32bit,bool64bit:
               procname := procname + 'bool';
               procname := procname + 'bool';
 {$endif}
 {$endif}
             else
             else
@@ -511,7 +512,10 @@ implementation
                       readfunctype:=s64currencytype;
                       readfunctype:=s64currencytype;
                       is_real:=true;
                       is_real:=true;
                     end;
                     end;
-                  pasbool,
+                  pasbool8,
+                  pasbool16,
+                  pasbool32,
+                  pasbool64,
                   bool8bit,
                   bool8bit,
                   bool16bit,
                   bool16bit,
                   bool32bit,
                   bool32bit,
@@ -524,7 +528,7 @@ implementation
                     else
                     else
                       begin
                       begin
                         name := procprefixes[do_read]+'boolean';
                         name := procprefixes[do_read]+'boolean';
-                        readfunctype:=booltype;
+                        readfunctype:=pasbool8type;
                       end
                       end
                   else
                   else
                     begin
                     begin
@@ -746,7 +750,7 @@ implementation
                   { zero-based                                       }
                   { zero-based                                       }
                   if para.left.resultdef.typ=arraydef then
                   if para.left.resultdef.typ=arraydef then
                     para := ccallparanode.create(cordconstnode.create(
                     para := ccallparanode.create(cordconstnode.create(
-                      ord(tarraydef(para.left.resultdef).lowrange=0),booltype,false),para);
+                      ord(tarraydef(para.left.resultdef).lowrange=0),pasbool8type,false),para);
                   { create the call statement }
                   { create the call statement }
                   addstatement(Tstatementnode(newstatement),
                   addstatement(Tstatementnode(newstatement),
                     ccallnode.createintern(name,para));
                     ccallnode.createintern(name,para));
@@ -1635,7 +1639,7 @@ implementation
                    else
                    else
                      hp:=create_simplified_ord_const(sqr(vl.uvalue),resultdef,forinline);
                      hp:=create_simplified_ord_const(sqr(vl.uvalue),resultdef,forinline);
                  in_const_odd :
                  in_const_odd :
-                   hp:=cordconstnode.create(qword(odd(int64(vl))),booltype,true);
+                   hp:=cordconstnode.create(qword(odd(int64(vl))),pasbool8type,true);
                  in_const_swap_word :
                  in_const_swap_word :
                    hp:=cordconstnode.create((vl and $ff) shl 8+(vl shr 8),left.resultdef,true);
                    hp:=cordconstnode.create((vl and $ff) shl 8+(vl shr 8),left.resultdef,true);
                  in_const_swap_long :
                  in_const_swap_long :
@@ -1691,19 +1695,32 @@ implementation
                     orddef :
                     orddef :
                       begin
                       begin
                         case torddef(left.resultdef).ordtype of
                         case torddef(left.resultdef).ordtype of
-                          pasbool,
+                          pasbool8,
                           uchar:
                           uchar:
                             begin
                             begin
                               { change to byte() }
                               { change to byte() }
                               result:=ctypeconvnode.create_internal(left,u8inttype);
                               result:=ctypeconvnode.create_internal(left,u8inttype);
                               left:=nil;
                               left:=nil;
                             end;
                             end;
+                          pasbool16,
                           uwidechar :
                           uwidechar :
                             begin
                             begin
                               { change to word() }
                               { change to word() }
                               result:=ctypeconvnode.create_internal(left,u16inttype);
                               result:=ctypeconvnode.create_internal(left,u16inttype);
                               left:=nil;
                               left:=nil;
                             end;
                             end;
+                          pasbool32 :
+                            begin
+                              { change to dword() }
+                              result:=ctypeconvnode.create_internal(left,u32inttype);
+                              left:=nil;
+                            end;
+                          pasbool64 :
+                            begin
+                              { change to qword() }
+                              result:=ctypeconvnode.create_internal(left,u64inttype);
+                              left:=nil;
+                            end;
                           bool8bit:
                           bool8bit:
                             begin
                             begin
                               { change to shortint() }
                               { change to shortint() }
@@ -2357,7 +2374,7 @@ implementation
                     in procvar handling between FPC and Delphi handling, so
                     in procvar handling between FPC and Delphi handling, so
                     handle specially }
                     handle specially }
                   set_varstate(tcallparanode(left).left,vs_read,[vsf_must_be_valid]);
                   set_varstate(tcallparanode(left).left,vs_read,[vsf_must_be_valid]);
-                  resultdef:=booltype;
+                  resultdef:=pasbool8type;
                 end;
                 end;
 
 
               in_ofs_x :
               in_ofs_x :

+ 5 - 2
compiler/nmat.pas

@@ -884,14 +884,17 @@ implementation
              v:=tordconstnode(left).value;
              v:=tordconstnode(left).value;
              def:=left.resultdef;
              def:=left.resultdef;
              case torddef(left.resultdef).ordtype of
              case torddef(left.resultdef).ordtype of
-               pasbool,
+               pasbool8,
+               pasbool16,
+               pasbool32,
+               pasbool64,
                bool8bit,
                bool8bit,
                bool16bit,
                bool16bit,
                bool32bit,
                bool32bit,
                bool64bit:
                bool64bit:
                  begin
                  begin
                    v:=byte(not(boolean(int64(v))));
                    v:=byte(not(boolean(int64(v))));
-                   if (torddef(left.resultdef).ordtype<>pasbool) then
+                   if is_cbool(left.resultdef) then
                      v:=-v;
                      v:=-v;
                  end;
                  end;
                uchar,
                uchar,

+ 6 - 6
compiler/nset.pas

@@ -213,7 +213,7 @@ implementation
 
 
       begin
       begin
          result:=nil;
          result:=nil;
-         resultdef:=booltype;
+         resultdef:=pasbool8type;
          typecheckpass(right);
          typecheckpass(right);
          set_varstate(right,vs_read,[vsf_must_be_valid]);
          set_varstate(right,vs_read,[vsf_must_be_valid]);
          if codegenerror then
          if codegenerror then
@@ -256,7 +256,7 @@ implementation
              }
              }
              if  (
              if  (
                    (left.resultdef.typ = orddef) and not
                    (left.resultdef.typ = orddef) and not
-                   (torddef(left.resultdef).ordtype in [s8bit,u8bit,uchar,pasbool,bool8bit])
+                   (torddef(left.resultdef).ordtype in [s8bit,u8bit,uchar,pasbool8,bool8bit])
                  )
                  )
                 or
                 or
                  (
                  (
@@ -294,7 +294,7 @@ implementation
             ((right.nodetype = setconstn) and
             ((right.nodetype = setconstn) and
              (tnormalset(tsetconstnode(right).value_set^) = [])) then
              (tnormalset(tsetconstnode(right).value_set^) = [])) then
           begin
           begin
-            t:=cordconstnode.create(0,booltype,false);
+            t:=cordconstnode.create(0,pasbool8type,false);
             typecheckpass(t);
             typecheckpass(t);
             result:=t;
             result:=t;
             exit;
             exit;
@@ -321,10 +321,10 @@ implementation
                  { into account                                             }
                  { into account                                             }
                  if Tordconstnode(left).value.signed then
                  if Tordconstnode(left).value.signed then
                    t:=cordconstnode.create(byte(tordconstnode(left).value.svalue in Tsetconstnode(right).value_set^),
                    t:=cordconstnode.create(byte(tordconstnode(left).value.svalue in Tsetconstnode(right).value_set^),
-                     booltype,true)
+                     pasbool8type,true)
                  else
                  else
                    t:=cordconstnode.create(byte(tordconstnode(left).value.uvalue in Tsetconstnode(right).value_set^),
                    t:=cordconstnode.create(byte(tordconstnode(left).value.uvalue in Tsetconstnode(right).value_set^),
-                     booltype,true);
+                     pasbool8type,true);
                  typecheckpass(t);
                  typecheckpass(t);
                  result:=t;
                  result:=t;
                  exit;
                  exit;
@@ -334,7 +334,7 @@ implementation
                  if (Tordconstnode(left).value<int64(tsetdef(right.resultdef).setbase)) or
                  if (Tordconstnode(left).value<int64(tsetdef(right.resultdef).setbase)) or
                     (Tordconstnode(left).value>int64(Tsetdef(right.resultdef).setmax)) then
                     (Tordconstnode(left).value>int64(Tsetdef(right.resultdef).setmax)) then
                    begin
                    begin
-                     t:=cordconstnode.create(0, booltype, true);
+                     t:=cordconstnode.create(0, pasbool8type, true);
                      typecheckpass(t);
                      typecheckpass(t);
                      result:=t;
                      result:=t;
                      exit;
                      exit;

+ 1 - 1
compiler/pdecsub.pas

@@ -1468,7 +1468,7 @@ implementation
                        end;
                        end;
                      if (optoken in [_EQ,_NE,_GT,_LT,_GTE,_LTE,_OP_IN]) and
                      if (optoken in [_EQ,_NE,_GT,_LT,_GTE,_LTE,_OP_IN]) and
                         ((pd.returndef.typ<>orddef) or
                         ((pd.returndef.typ<>orddef) or
-                         (torddef(pd.returndef).ordtype<>pasbool)) then
+                         (torddef(pd.returndef).ordtype<>pasbool8)) then
                         Message(parser_e_comparative_operator_return_boolean);
                         Message(parser_e_comparative_operator_return_boolean);
                      if (optoken in [_ASSIGNMENT,_OP_EXPLICIT]) and
                      if (optoken in [_ASSIGNMENT,_OP_EXPLICIT]) and
                         equal_defs(pd.returndef,tparavarsym(pd.parast.SymList[0]).vardef) and
                         equal_defs(pd.returndef,tparavarsym(pd.parast.SymList[0]).vardef) and

+ 1 - 1
compiler/pdecvar.pas

@@ -674,7 +674,7 @@ implementation
                                    storedprocdef:=tprocvardef.create(normal_function_level);
                                    storedprocdef:=tprocvardef.create(normal_function_level);
                                    include(storedprocdef.procoptions,po_methodpointer);
                                    include(storedprocdef.procoptions,po_methodpointer);
                                    { Return type must be boolean }
                                    { Return type must be boolean }
-                                   storedprocdef.returndef:=booltype;
+                                   storedprocdef.returndef:=pasbool8type;
                                    { Add index parameter if needed }
                                    { Add index parameter if needed }
                                    if ppo_indexed in p.propoptions then
                                    if ppo_indexed in p.propoptions then
                                      begin
                                      begin

+ 2 - 2
compiler/pexpr.pas

@@ -2745,13 +2745,13 @@ implementation
              _TRUE :
              _TRUE :
                begin
                begin
                  consume(_TRUE);
                  consume(_TRUE);
-                 p1:=cordconstnode.create(1,booltype,false);
+                 p1:=cordconstnode.create(1,pasbool8type,false);
                end;
                end;
 
 
              _FALSE :
              _FALSE :
                begin
                begin
                  consume(_FALSE);
                  consume(_FALSE);
-                 p1:=cordconstnode.create(0,booltype,false);
+                 p1:=cordconstnode.create(0,pasbool8type,false);
                end;
                end;
 
 
              _NIL :
              _NIL :

+ 11 - 8
compiler/psystem.pas

@@ -154,7 +154,10 @@ implementation
         s32inttype:=torddef.create(s32bit,int64(low(longint)),int64(high(longint)));
         s32inttype:=torddef.create(s32bit,int64(low(longint)),int64(high(longint)));
         u64inttype:=torddef.create(u64bit,low(qword),high(qword));
         u64inttype:=torddef.create(u64bit,low(qword),high(qword));
         s64inttype:=torddef.create(s64bit,low(int64),high(int64));
         s64inttype:=torddef.create(s64bit,low(int64),high(int64));
-        booltype:=torddef.create(pasbool,0,1);
+        pasbool8type:=torddef.create(pasbool8,0,1);
+        pasbool16type:=torddef.create(pasbool16,0,1);
+        pasbool32type:=torddef.create(pasbool32,0,1);
+        pasbool64type:=torddef.create(pasbool64,0,1);
         bool8type:=torddef.create(bool8bit,low(int64),high(int64));
         bool8type:=torddef.create(bool8bit,low(int64),high(int64));
         bool16type:=torddef.create(bool16bit,low(int64),high(int64));
         bool16type:=torddef.create(bool16bit,low(int64),high(int64));
         bool32type:=torddef.create(bool32bit,low(int64),high(int64));
         bool32type:=torddef.create(bool32bit,low(int64),high(int64));
@@ -293,7 +296,7 @@ implementation
         addtype('UnicodeString',cunicodestringtype);
         addtype('UnicodeString',cunicodestringtype);
 
 
         addtype('OpenString',openshortstringtype);
         addtype('OpenString',openshortstringtype);
-        addtype('Boolean',booltype);
+        addtype('Boolean',pasbool8type);
         addtype('ByteBool',bool8type);
         addtype('ByteBool',bool8type);
         addtype('WordBool',bool16type);
         addtype('WordBool',bool16type);
         addtype('LongBool',bool32type);
         addtype('LongBool',bool32type);
@@ -333,7 +336,7 @@ implementation
         addtype('$widestring',cwidestringtype);
         addtype('$widestring',cwidestringtype);
         addtype('$unicodestring',cunicodestringtype);
         addtype('$unicodestring',cunicodestringtype);
         addtype('$openshortstring',openshortstringtype);
         addtype('$openshortstring',openshortstringtype);
-        addtype('$boolean',booltype);
+        addtype('$boolean',pasbool8type);
         addtype('$boolean8',bool8type);
         addtype('$boolean8',bool8type);
         addtype('$boolean16',bool16type);
         addtype('$boolean16',bool16type);
         addtype('$boolean32',bool32type);
         addtype('$boolean32',bool32type);
@@ -438,11 +441,11 @@ implementation
             loadtype('sc80real',sc80floattype);
             loadtype('sc80real',sc80floattype);
           end;
           end;
         loadtype('s64currency',s64currencytype);
         loadtype('s64currency',s64currencytype);
-        loadtype('boolean',booltype);
-        loadtype('boolean8',bool8type);
-        loadtype('boolean16',bool16type);
-        loadtype('boolean32',bool32type);
-        loadtype('boolean64',bool64type);
+        loadtype('boolean',pasbool8type);
+        loadtype('boolean8',pasbool8type);
+        loadtype('boolean16',pasbool16type);
+        loadtype('boolean32',pasbool32type);
+        loadtype('boolean64',pasbool64type);
         loadtype('void_pointer',voidpointertype);
         loadtype('void_pointer',voidpointertype);
         loadtype('char_pointer',charpointertype);
         loadtype('char_pointer',charpointertype);
         loadtype('widechar_pointer',widecharpointertype);
         loadtype('widechar_pointer',widecharpointertype);

+ 4 - 1
compiler/ptconst.pas

@@ -196,7 +196,7 @@ implementation
            if is_cbool(def) then
            if is_cbool(def) then
              inserttypeconv(n,def);
              inserttypeconv(n,def);
            case def.ordtype of
            case def.ordtype of
-              pasbool,
+              pasbool8,
               bool8bit :
               bool8bit :
                 begin
                 begin
                    if is_constboolnode(n) then
                    if is_constboolnode(n) then
@@ -204,6 +204,7 @@ implementation
                    else
                    else
                      do_error;
                      do_error;
                 end;
                 end;
+              pasbool16,
               bool16bit :
               bool16bit :
                 begin
                 begin
                    if is_constboolnode(n) then
                    if is_constboolnode(n) then
@@ -211,6 +212,7 @@ implementation
                    else
                    else
                      do_error;
                      do_error;
                 end;
                 end;
+              pasbool32,
               bool32bit :
               bool32bit :
                 begin
                 begin
                    if is_constboolnode(n) then
                    if is_constboolnode(n) then
@@ -218,6 +220,7 @@ implementation
                    else
                    else
                      do_error;
                      do_error;
                 end;
                 end;
+              pasbool64,
               bool64bit :
               bool64bit :
                 begin
                 begin
                    if is_constboolnode(n) then
                    if is_constboolnode(n) then

+ 4 - 3
compiler/ptype.pas

@@ -685,7 +685,7 @@ implementation
                 member_blocktype:=bt_type;
                 member_blocktype:=bt_type;
 
 
                 { local and anonymous records can not have inner types. skip top record symtable }
                 { local and anonymous records can not have inner types. skip top record symtable }
-                if (current_structdef.objname^='') or 
+                if (current_structdef.objname^='') or
                    not(symtablestack.stack^.next^.symtable.symtabletype in [globalsymtable,staticsymtable,objectsymtable,recordsymtable]) then
                    not(symtablestack.stack^.next^.symtable.symtabletype in [globalsymtable,staticsymtable,objectsymtable,recordsymtable]) then
                   Message(parser_e_no_types_in_local_anonymous_records);
                   Message(parser_e_no_types_in_local_anonymous_records);
               end;
               end;
@@ -1052,7 +1052,7 @@ implementation
                                def:=torddef.create(uchar,lv,hv)
                                def:=torddef.create(uchar,lv,hv)
                              else
                              else
                                if is_boolean(pt1.resultdef) then
                                if is_boolean(pt1.resultdef) then
-                                 def:=torddef.create(pasbool,lv,hv)
+                                 def:=torddef.create(pasbool8,lv,hv)
                                else if is_signed(pt1.resultdef) then
                                else if is_signed(pt1.resultdef) then
                                  def:=torddef.create(range_to_basetype(lv,hv),lv,hv)
                                  def:=torddef.create(range_to_basetype(lv,hv),lv,hv)
                                else
                                else
@@ -1172,7 +1172,8 @@ implementation
 {$ifdef cpu64bitaddr}
 {$ifdef cpu64bitaddr}
                     u32bit,s64bit,
                     u32bit,s64bit,
 {$endif cpu64bitaddr}
 {$endif cpu64bitaddr}
-                    pasbool,bool8bit,bool16bit,bool32bit,bool64bit,
+                    pasbool8,pasbool16,pasbool32,pasbool64,
+                    bool8bit,bool16bit,bool32bit,bool64bit,
                     uwidechar] then
                     uwidechar] then
                     begin
                     begin
                        lowval:=torddef(def).low;
                        lowval:=torddef(def).low;

+ 2 - 1
compiler/symconst.pas

@@ -210,7 +210,8 @@ type
     uvoid,
     uvoid,
     u8bit,u16bit,u32bit,u64bit,
     u8bit,u16bit,u32bit,u64bit,
     s8bit,s16bit,s32bit,s64bit,
     s8bit,s16bit,s32bit,s64bit,
-    pasbool,bool8bit,bool16bit,bool32bit,bool64bit,
+    pasbool8,pasbool16,pasbool32,pasbool64,
+    bool8bit,bool16bit,bool32bit,bool64bit,
     uchar,uwidechar,scurrency
     uchar,uwidechar,scurrency
   );
   );
 
 

+ 12 - 5
compiler/symdef.pas

@@ -677,7 +677,10 @@ interface
        voidtype,                  { Void (procedure) }
        voidtype,                  { Void (procedure) }
        cchartype,                 { Char }
        cchartype,                 { Char }
        cwidechartype,             { WideChar }
        cwidechartype,             { WideChar }
-       booltype,                  { boolean type }
+       pasbool8type,              { boolean type }
+       pasbool16type,
+       pasbool32type,
+       pasbool64type,
        bool8type,
        bool8type,
        bool16type,
        bool16type,
        bool32type,
        bool32type,
@@ -1766,7 +1769,8 @@ implementation
           0,
           0,
           1,2,4,8,
           1,2,4,8,
           1,2,4,8,
           1,2,4,8,
-          1,1,2,4,8,
+          1,2,4,8,
+          1,2,4,8,
           1,2,8
           1,2,8
         );
         );
       begin
       begin
@@ -1815,7 +1819,8 @@ implementation
           varUndefined,
           varUndefined,
           varbyte,varword,varlongword,varqword,
           varbyte,varword,varlongword,varqword,
           varshortint,varsmallint,varinteger,varint64,
           varshortint,varsmallint,varinteger,varint64,
-          varboolean,varboolean,varboolean,varUndefined,varUndefined,
+          varboolean,varboolean,varboolean,varboolean,
+          varboolean,varboolean,varUndefined,varUndefined,
           varUndefined,varUndefined,varCurrency);
           varUndefined,varUndefined,varCurrency);
       begin
       begin
         result:=basetype2vardef[ordtype];
         result:=basetype2vardef[ordtype];
@@ -1844,7 +1849,8 @@ implementation
           'untyped',
           'untyped',
           'Byte','Word','DWord','QWord',
           'Byte','Word','DWord','QWord',
           'ShortInt','SmallInt','LongInt','Int64',
           'ShortInt','SmallInt','LongInt','Int64',
-          'Boolean','ByteBool','WordBool','LongBool','QWordBool',
+          'Boolean','Boolean16','Boolean32','Boolean64',
+          'ByteBool','WordBool','LongBool','QWordBool',
           'Char','WideChar','Currency');
           'Char','WideChar','Currency');
 
 
       begin
       begin
@@ -3929,7 +3935,8 @@ implementation
              'v',
              'v',
              'h','t','j','y',
              'h','t','j','y',
              'a','s','i','x',
              'a','s','i','x',
-             'b','b','b','b','b',
+             'b','b','b','b',
+             'b','b','b','b',
              'c','w','x');
              'c','w','x');
 
 
            floattype2str : array[tfloattype] of string[1] = (
            floattype2str : array[tfloattype] of string[1] = (

+ 1 - 1
compiler/x86/cgx86.pas

@@ -2208,7 +2208,7 @@ unit cgx86;
          current_asmdata.getjumplabel(hl);
          current_asmdata.getjumplabel(hl);
          if not ((def.typ=pointerdef) or
          if not ((def.typ=pointerdef) or
                 ((def.typ=orddef) and
                 ((def.typ=orddef) and
-                 (torddef(def).ordtype in [u64bit,u16bit,u32bit,u8bit,uchar,pasbool]))) then
+                 (torddef(def).ordtype in [u64bit,u16bit,u32bit,u8bit,uchar,pasbool8,pasbool16,pasbool32,pasbool64]))) then
            cond:=C_NO
            cond:=C_NO
          else
          else
            cond:=C_NB;
            cond:=C_NB;