This is an archive of the discontinued LLVM Phabricator instance.

Revert "Set FLT_EVAL_METHOD to -1 when fast-math is enabled."
AcceptedPublic

Authored by zahiraam on Mar 9 2023, 10:24 AM.

Details

Summary

Setting FLT_EVAL_METHOD to -1 with fast-math will set __GLIBC_FLT_EVAL_METHOD to 2 and long double ends up being used for
float_t and double_t. This creates some ABI breakage with various C libraries.

See details here: https://github.com/llvm/llvm-project/issues/60781

This reverts commit bbf0d1932a3c1be970ed8a580e51edf571b80fd5.

Diff Detail

Event Timeline

zahiraam created this revision.Mar 9 2023, 10:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2023, 10:24 AM
Herald added a subscriber: pengfei. · View Herald Transcript
zahiraam requested review of this revision.Mar 9 2023, 10:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2023, 10:24 AM

Tagging @davemgreen, @kito-cheng, @bjope and @Wilco1 for awareness.

Thank you for working on this! Because this is fixing an ABI break, if we can land this in time for the release candidate I think we should try to add this to 16.0 to limit damage. CC @tstellar for his opinion.

This doesn't seem to fully revert bbf0d1932a3c1be970ed8a580e51edf571b80fd5; that commit changed clang/lib/Sema/Sema.cpp but this commit does not back those changes out. Is that intentional?

clang/test/Preprocessor/flt_eval_macro.cpp
66–67

This line is no longer needed because it will never be checked.

Thank you for working on this! Because this is fixing an ABI break, if we can land this in time for the release candidate I think we should try to add this to 16.0 to limit damage. CC @tstellar for his opinion.

This doesn't seem to fully revert bbf0d1932a3c1be970ed8a580e51edf571b80fd5; that commit changed clang/lib/Sema/Sema.cpp but this commit does not back those changes out. Is that intentional?

Yes that makes sense because the changes in Sema were moved to lib/lex/Preprocessor.cpp in this patch: https://reviews.llvm.org/D128814

zahiraam updated this revision to Diff 503863.Mar 9 2023, 11:34 AM
zahiraam updated this revision to Diff 503865.Mar 9 2023, 11:38 AM

Thank you for working on this! Because this is fixing an ABI break, if we can land this in time for the release candidate I think we should try to add this to 16.0 to limit damage. CC @tstellar for his opinion.

This doesn't seem to fully revert bbf0d1932a3c1be970ed8a580e51edf571b80fd5; that commit changed clang/lib/Sema/Sema.cpp but this commit does not back those changes out. Is that intentional?

Yes that makes sense because the changes in Sema were moved to lib/lex/Preprocessor.cpp in this patch: https://reviews.llvm.org/D128814

Ah, thank you for the explanation, that makes sense.

This variant comes with a .patch file added to the PR; that should be deleted in the next round. Aside from that, the changes LGTM, but I'd like to give precommit CI a chance to complete and some time for the folks impacted by the changes to weigh in before accepting.

This variant comes with a .patch file added to the PR; that should be deleted in the next round. Aside from that, the changes LGTM, but I'd like to give precommit CI a chance to complete and some time for the folks impacted by the changes to weigh in before accepting.

Heh you caught the .patch file and already fixed it, thanks!

We're holding -rc4 until this is merged, so it would be great if we could merge it on Friday.

aaron.ballman accepted this revision.Mar 10 2023, 5:36 AM

LGTM! If you don't hear otherwise from @kito-cheng, @bjope, @Wilco1 in the next ~4 hours, feel free to land.

This revision is now accepted and ready to land.Mar 10 2023, 5:36 AM

LGTM! If you don't hear otherwise from @kito-cheng, @bjope, @Wilco1 in the next ~4 hours, feel free to land.

Great! Thanks @aaron.ballman and @tstellar.

bjope added a comment.Mar 10 2023, 5:41 AM

I have no objections about doing this revert.

clang/test/CodeGen/X86/fexcess-precision.c