diff --git a/lib/Target/TargetLibraryInfo.cpp b/lib/Target/TargetLibraryInfo.cpp index b208bfd3728..93c008af350 100644 --- a/lib/Target/TargetLibraryInfo.cpp +++ b/lib/Target/TargetLibraryInfo.cpp @@ -574,14 +574,11 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T, TLI.setUnavailable(LibFunc::llabs); } - // exp10, exp10f, exp10l is available on at least Linux (GLIBC) - // exp10 and exp10f are not available on OS X until 10.9 and iOS until 7.0 - // and their names are __exp10 and __exp10f. exp10l is not available on - // OS X or iOS. switch (T.getOS()) { - case Triple::Linux: - break; case Triple::MacOSX: + // exp10 and exp10f are not available on OS X until 10.9 and iOS until 7.0 + // and their names are __exp10 and __exp10f. exp10l is not available on + // OS X or iOS. TLI.setUnavailable(LibFunc::exp10l); if (T.isMacOSXVersionLT(10, 9)) { TLI.setUnavailable(LibFunc::exp10); @@ -601,6 +598,13 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T, TLI.setAvailableWithName(LibFunc::exp10f, "__exp10f"); } break; + case Triple::Linux: + // exp10, exp10f, exp10l is available on Linux (GLIBC) but are extremely + // buggy prior to glibc version 2.18. Until this version is widely deployed + // or we have a reasonable detection strategy, we cannot use exp10 reliably + // on Linux. + // + // Fall through to disable all of them. default: TLI.setUnavailable(LibFunc::exp10); TLI.setUnavailable(LibFunc::exp10f); diff --git a/test/Transforms/InstCombine/double-float-shrink-1.ll b/test/Transforms/InstCombine/double-float-shrink-1.ll index 5cacb591e00..d958470f1ba 100644 --- a/test/Transforms/InstCombine/double-float-shrink-1.ll +++ b/test/Transforms/InstCombine/double-float-shrink-1.ll @@ -157,7 +157,10 @@ define float @exp10_test(float %f) nounwind readnone { %call = call double @exp10(double %conv) %conv1 = fptrunc double %call to float ret float %conv1 -; CHECK: call float @exp10f(float %f) +; FIXME: Re-enable this when Linux allows transforming this again, or when we +; can use builtin attributes to test the transform regardless of OS. +; DISABLED-CHECK: call float @exp10f(float %f) +; CHECK: call double @exp10(double %conv) } define double @exp10_test2(float %f) nounwind readnone {