This is an archive of the discontinued LLVM Phabricator instance.

[clang] Fix -fp-model={strict|precise} to disable -fapprox-func
ClosedPublic

Authored by kawashima-fj on Nov 16 2022, 2:47 AM.

Details

Summary

-fapprox-func should be disabled by -fp-model={strict|precise}, as well as other fast-math flags. See the last changes in clang/test/Driver/fp-model.c.

Probably this route (case options::OPT_ffp_model_EQ) was forgot to update in D106191 and D114564. There is no appropriate reason not to disable the flag.

This commit also updates other regression tests, which are not directly related to this bug, for consistency with other fast-math flags.

Diff Detail

Event Timeline

kawashima-fj created this revision.Nov 16 2022, 2:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2022, 2:47 AM
kawashima-fj requested review of this revision.Nov 16 2022, 2:47 AM

I found some errors in Clang Compiler User’s Manual. I will update of the Manual in another patch.

This revision is now accepted and ready to land.Nov 16 2022, 7:32 AM
zahiraam added inline comments.Nov 16 2022, 8:08 AM
clang/test/Driver/fp-model.c
180

Shouldn't be worth adding a rule for -ffast-math and ffp-model=fast (even if it seems redundant)?

Update a test to include the ffast-math -ffp-model=fast pattern.

kawashima-fj marked an inline comment as done.Nov 16 2022, 6:32 PM
kawashima-fj added inline comments.
clang/test/Driver/fp-model.c
180

-ffast-math -ffp-model=fast is added at line 134.

Update a test to include the ffast-math -ffp-model=fast pattern.

Thanks. Looks good to me.

zahiraam accepted this revision.Nov 17 2022, 5:14 AM
This revision was automatically updated to reflect the committed changes.
kawashima-fj marked an inline comment as done.