Skip to content

Building with -ffast-math causes floating-point value differences depending on compiler (GCC vs Clang) #24540

Description

@Dar13

Godot version:
master @ e8cdbf9

OS/device including version:
Linux 4.19.10, GCC 8.2.1, Clang 7.0.1

Issue description:
When building with the release_debug target, the value of a single pixel of movement is different when building with GCC compared to LLVM/Clang. I've narrowed it down to the -ffast-math flag that's used in the release_debug CCFLAGS variable. Was found when testing out input according to #24363.

Configuration GCC LLVM
release_debug, -ffast-math 1 x 1 0.999023 x 0.998333
release_debug, no -ffast-math 1 x 1 1 x 1

Steps to reproduce:

  1. Build with Clang 7.0.1 on Linux
  2. Run attached example scene with script
  3. See above results when moving mouse by a pixel

Minimal reproduction project:
input_test.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions