[cfe-dev] Warning for partially implemented options/pragmas?

Nemanja Ivanovic via cfe-dev cfe-dev at lists.llvm.org
Thu Apr 23 07:00:55 PDT 2020


I think it would be quite useful to add this in the front end. The way I
envision this working is that targets would specify whether they support
constrained FP intrinsics. If this flag is unset, it would cause the front
end to do two things:
1. Warn the user that the mode is not supported for the target
2. Ignore the option and not generate the constrained FP intrinsics

This should additionally be coupled with a temporary option for developers
to use to aid in developing support for the intrinsics.
Something like: -ftrapping-math-on-unsupported-target and
-frounding-math-on-unsupported-target.


On Thu, Apr 16, 2020 at 4:19 PM Cameron McInally via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> On Thu, Apr 16, 2020 at 4:01 PM Kevin Neal via cfe-dev
> <cfe-dev at lists.llvm.org> wrote:
> >
> > Bug 45329 “segfault with frounding-math” “
> https://bugs.llvm.org/show_bug.cgi?id=45329” highlights that we are
> silently allowing people to use options that are unimplemented or only
> partially implemented.
> >
> > If use the -frounding-math option on a compile I expect it to work. I do
> not expect it to trigger an ICE, a crash, or much worse silently not work
> and produce wrong results.
> >
> > I propose a warning be printed so that we can avoid issues like bug
> 45329 in the future. And it needs to be per-target since some targets are
> closer to supporting this feature than others.
> >
> > Thoughts?
>
> Thanks for bringing this up, Kevin.
>
> We have a customer code that has been using
> `-fno-unsafe-math-optimizations` for some time. That option implies
> `-ftrapping-math`, which was a no-op until a few months ago. Now,
> `-ftrapping-math` enables the constrained FP intrinsics, which aren't
> fully supported on all targets. That behavior change looked like a
> regression to the customer.
>
> A warning would be a good short-term solution.
>
> -Cameron
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200423/dc99dce3/attachment.html>


More information about the cfe-dev mailing list