@@ -383,8 +383,7 @@ c_typecastt::c_typet c_typecastt::get_c_type(
383
383
return BOOL;
384
384
else if (type.id ()==ID_c_bool)
385
385
return BOOL;
386
- else if (type.id ()==ID_floatbv ||
387
- type.id ()==ID_fixedbv)
386
+ else if (type.id ()==ID_floatbv)
388
387
{
389
388
if (width<=config.ansi_c .single_width )
390
389
return SINGLE;
@@ -395,6 +394,10 @@ c_typecastt::c_typet c_typecastt::get_c_type(
395
394
else if (width<=128 )
396
395
return FLOAT128;
397
396
}
397
+ else if (type.id ()==ID_fixedbv)
398
+ {
399
+ return FIXEDBV;
400
+ }
398
401
else if (type.id ()==ID_pointer)
399
402
{
400
403
if (type.subtype ().id ()==ID_empty)
@@ -728,8 +731,8 @@ void c_typecastt::implicit_typecast_arithmetic(
728
731
if (max_type==LARGE_SIGNED_INT || max_type==LARGE_UNSIGNED_INT)
729
732
{
730
733
// get the biggest width of both
731
- unsigned width1=type1.get_int (ID_width);
732
- unsigned width2=type2.get_int (ID_width);
734
+ std:: size_t width1=type1.get_size_t (ID_width);
735
+ std:: size_t width2=type2.get_size_t (ID_width);
733
736
734
737
// produce type
735
738
typet result_type;
@@ -751,6 +754,30 @@ void c_typecastt::implicit_typecast_arithmetic(
751
754
752
755
return ;
753
756
}
757
+ else if (max_type==FIXEDBV)
758
+ {
759
+ typet result_type;
760
+
761
+ if (c_type1==FIXEDBV && c_type2==FIXEDBV)
762
+ {
763
+ // get bigger of both
764
+ std::size_t width1=to_fixedbv_type (type1).get_width ();
765
+ std::size_t width2=to_fixedbv_type (type2).get_width ();
766
+ if (width1>=width2)
767
+ result_type=type1;
768
+ else
769
+ result_type=type2;
770
+ }
771
+ else if (c_type1==FIXEDBV)
772
+ result_type=type1;
773
+ else
774
+ result_type=type2;
775
+
776
+ do_typecast (expr1, result_type);
777
+ do_typecast (expr2, result_type);
778
+
779
+ return ;
780
+ }
754
781
else if (max_type==COMPLEX)
755
782
{
756
783
if (c_type1==COMPLEX && c_type2==COMPLEX)
0 commit comments