This is an archive of the discontinued LLVM Phabricator instance.

[PATCH] When pragma FENV_ACCESS is ignored do not modify Sema.CurFPFeatures
ClosedPublic

Authored by mibintc on May 6 2020, 11:53 AM.

Details

Summary

Bug reported by @uabelho against reviews.llvm.org/D72841
pragma STDC FENV_ACCESS ON is ignored, but the floating point state maintained in Sema.CurFPFeatures was modified to show that
fenv_access was enabled, this caused llvm constrained intrinsics to be created which is erroneous. This is a small patch to avoid modifying the state.

Diff Detail

Event Timeline

mibintc created this revision.May 6 2020, 11:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2020, 11:54 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
mibintc marked 2 inline comments as done.May 6 2020, 11:56 AM
mibintc added inline comments.
clang/lib/Parse/ParsePragma.cpp
111

Modified this to return instead of making changes which will ultimately modify the floating point state

clang/test/CodeGen/fp-floatcontrol-pragma.cpp
61

I used a modified version of @uabelho 's test. I verified that before this bug fix a constrained intrinsic was being created for this multiply.

This revision is now accepted and ready to land.May 6 2020, 12:53 PM
This revision was automatically updated to reflect the committed changes.

Great! Thanks!