[all-commits] [llvm/llvm-project] 915967: [MLIR][Presburger] Disambiguate call to floor

rorth via All-commits all-commits at lists.llvm.org
Wed Feb 9 13:02:24 PST 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 91596755359e29c677bfa84d86edcaa1e70df955
  Author: Rainer Orth <ro at gcc.gnu.org>
  Date:   2022-02-09 (Wed, 09 Feb 2022)

  Changed paths:
    M mlir/lib/Analysis/Presburger/Utils.cpp

  Log Message:
  [MLIR][Presburger] Disambiguate call to floor

While testing LLVM 14.0.0 rc1 on Solaris, compilation of `FAIL`ed with

  /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/Analysis/Presburger/Utils.cpp: In lambda function:
  /var/llvm/llvm-14.0.0-rc1/rc1/llvm-project/mlir/lib/Analysis/Presburger/Utils.cpp:48:58: error: call of overloaded ‘floor(int64_t)’ is ambiguous
     48 |                  [gcd](int64_t &n) { return floor(n / gcd); });
        |                                                          ^
note: candidate: ‘long double std::floor(long double)’
    201 |  inline long double floor(long double __X) { return __floorl(__X); }
        |                     ^~~~~
note: candidate: ‘float std::floor(float)’
    165 |  inline float floor(float __X) { return __floorf(__X); }
        |               ^~~~~
note: candidate: ‘double std::floor(double)’
     78 | extern double floor __P((double));
        |               ^~~~~

The same issue had already occured in the past, cf. D108750
<https://reviews.llvm.org/D108750>, and the solution is the same: cast the
`floor` arg to `double`.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D119324

More information about the All-commits mailing list