[all-commits] [llvm/llvm-project] fb85a2: Fix -fno-unsafe-math-optimizations behavior (#89473)

Andy Kaylor via All-commits all-commits at lists.llvm.org
Tue Apr 30 14:44:07 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fb85a282d125a2805632285b29686392e6922b66
      https://github.com/llvm/llvm-project/commit/fb85a282d125a2805632285b29686392e6922b66
  Author: Andy Kaylor <andrew.kaylor at intel.com>
  Date:   2024-04-30 (Tue, 30 Apr 2024)

  Changed paths:
    M clang/docs/UsersManual.rst
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/test/Driver/fast-math.c

  Log Message:
  -----------
  Fix -fno-unsafe-math-optimizations behavior (#89473)

This changes the handling of -fno-unsafe-fp-math to stop having that
option imply -ftrapping-math. In gcc, -fno-unsafe-math-optimizations
sets -ftrapping-math, but that dependency is based on the fact the
-ftrapping-math is enabled by default in gcc. Because clang does not
enable -ftrapping-math by default, there is no reason for
-fno-unsafe-math-optimizations to set it.

On the other hand, -funsafe-math-optimizations continues to imply
-fno-trapping-math because this option necessarily disables strict
exception semantics.

This fixes https://github.com/llvm/llvm-project/issues/87523



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list