Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled LLVM intrinsic generated from math.c #794

Open
keram88 opened this issue Feb 19, 2023 · 1 comment
Open

Unhandled LLVM intrinsic generated from math.c #794

keram88 opened this issue Feb 19, 2023 · 1 comment

Comments

@keram88
Copy link
Contributor

keram88 commented Feb 19, 2023

In the function fmodf there is a call to a Smack defined copysignf function. However, Clang generates a call to the llvm.copysign.f32 intrinsic instead. This is an issue because Smack doesn't currently model this intrinsic.
There are two issues here:

  • Why is Clang replacing this function?, and
  • Smack should add support for this family of intrinsics
@keram88
Copy link
Contributor Author

keram88 commented Feb 28, 2023

This program produces this intrinsic:

#include "smack.h"
#include <math.h>

int main() {
  double f = __VERIFIER_nondet_double();
  __VERIFIER_assume(!isnan(f));
  __VERIFIER_assume(0.0 < f);
  __VERIFIER_assume(isfinite(f));
  double z = fmodf(f, 2.0);
  __VERIFIER_assert(z <= 2.0);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant