https://bugs.llvm.org/show_bug.cgi?id=52507

            Bug ID: 52507
           Summary: Possible missing libm functions, ICE on reproducible
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Clang Compiler Support
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Test case reported by Wael Elwasif,

#include <omp.h>
#include <math.h>
#include <cstdio>

int main(int argc, char **argv){
     float a = 1.5;

#pragma omp target map(tofrom: a)
     {
     a = floor(a);
     }
     printf("a = %lf\n", a);
}

Reported failure mode:
clang++ -std=c++17 -lm -O3 -fopenmp -target x86_64-pc-linux-gnu
-fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa
-march=gfx90a  ./test_cmath.cpp
lld: error: undefined symbol: floorf

where changing the call to floorf, or the type to double, links OK.

However, on attempting to reproduce this, I get a segv on trunk:

https://godbolt.org/z/azsvd84fn

#3 0x0000558c2e2f6ff6 (anonymous
namespace)::AAKernelInfoFunction::changeToSPMDMode(llvm::Attributor&,
llvm::ChangeStatus&) (.constprop.1276) OpenMPOpt.cpp:0:0
 #4 0x0000558c2e2f7de7 (anonymous
namespace)::AAKernelInfoFunction::manifest(llvm::Attributor&) OpenMPOpt.cpp:0:0
 #5 0x0000558c2e22181c llvm::Attributor::manifestAttributes()
(/opt/compiler-explorer/clang-trunk-20211115/bin/clang-14+0x2c2181c)
 #6 0x0000558c2e22d61b llvm::Attributor::run()
(/opt/compiler-explorer/clang-trunk-20211115/bin/clang-14+0x2c2d61b)
 #7 0x0000558c2e300ec8 (anonymous namespace)::OpenMPOpt::runAttributor(bool)
(.part.1214) OpenMPOpt.cpp:0:0
 #8 0x0000558c2e301531 (anonymous namespace)::OpenMPOpt::run(bool)
OpenMPOpt.cpp:0:0
 #9 0x0000558c2e3044d7 llvm::OpenMPOptPass::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/opt/compiler-explorer/clang-trunk-20211115/bin/clang-14+0x2d044d7)

Bug was reported to me ~3 days ago.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to