[all-commits] [llvm/llvm-project] f6f625: [clang] Do not clear FP pragma stack when instanti...

Serge Pavlov via All-commits all-commits at lists.llvm.org
Mon Nov 13 02:25:00 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f6f625f4c6c3cbeb8cf6b889cdafc848dd4cb117
      https://github.com/llvm/llvm-project/commit/f6f625f4c6c3cbeb8cf6b889cdafc848dd4cb117
  Author: Serge Pavlov <sepavloff at gmail.com>
  Date:   2023-11-13 (Mon, 13 Nov 2023)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    A clang/test/Sema/PR69717.cpp

  Log Message:
  -----------
  [clang] Do not clear FP pragma stack when instantiating functions (#70646)

When instantiation function, a call to Sema::resetFPOption was used to
set the FP options associated with AST node. However this function also
cleared FP pragma stack, and it is incorrect. Template instantiation
takes place on AST representation and semantic information like the FP
pragma stack should not affect it. This was a reason for miscompilation
in some cases.

To make the Sema interface more consistent, now `resetFPOptions` does
not clear FP pragma stack anymore. It is cleared in
`FpPragmaStackSaveRAII`, which is used in parsing only.

This change must fix https://github.com/llvm/llvm-project/issues/69717
(Problems with float_control pragma stack in Clang 17.x).




More information about the All-commits mailing list