Skip to content

TypedPython: narrow GCC fastmath to reassociation + FMA contract, like clang and MSVC #368

Closed

Description

@b-re-w

Owner decision (via leader 2026-11-05). cgen's GCC TP_FASTMATH_BEGIN uses optimize("fast-math"), which also enables finite-math-only (isnan / x != x folded away), unlike the clang (reassociate + contract) and MSVC macros.

Change: GCC uses optimize("associative-math,no-signed-zeros,no-trapping-math,fp-contract=fast") only. SPEC N-8 states the three compilers allow the same scope.

Done when: a test checks that x != x / isnan inside a fastmath function still works (runs under GCC on Linux CI) and the generated GCC macro no longer contains fast-math.

Activity

  1. added 2 commits that reference this issue on Nov 5, 2026
  2. b-re-w commented on Nov 5, 2026

    @b-re-w
    MemberAuthor

    Landed in develop via #369

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions