Menu

#3719 Casts from float to BitInt broken

closed-fixed
other
5
2025-08-08
2024-03-23
No

The following hits an assertion in SDCC (both 4.4.0 and current trunk):

float f;
unsigned _BitInt(8) i;

void h(void)
{
    i = f;
}

Related

Wiki: NGI0-Commons-SDCC

Discussion

  • Philipp Klaus Krause

    • summary: Castsfrom float to BitInt broken --> Casts from float to BitInt broken
     
  • Philipp Klaus Krause

     
  • Philipp Klaus Krause

    As of [r15561], this should now work for _BitInt of width up to 32 bits for non-pdk ports. For pdk ports, the tests fail, for width wider than 32 bits compilation fails.

     

    Related

    Commit: [r15561]

    • Philipp Klaus Krause

      The pdk test failures turned out to be an issue in codegen that could also affect some other casts to_BitInt. That is fixed in [r15565].

       

      Related

      Commit: [r15565]

  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
     
  • Philipp Klaus Krause

    The third, and I hope, last, part of this bug is fixed in [r15566].

     

    Related

    Commit: [r15566]

  • Philipp Klaus Krause

    • labels: --> pdk, _BitInt
     
  • Philipp Klaus Krause

    The third, and I hope, last, part of this bug is fixed in [r15566].

     

    Related

    Commit: [r15566]


Log in to post a comment.

MongoDB Logo MongoDB