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

Floating point modulus (and probably other llvm instrs) calls libc without stack switch #5702

Closed
brson opened this issue Apr 3, 2013 · 7 comments

Comments

@brson
Copy link
Contributor

brson commented Apr 3, 2013

As seen in #5697, LLVM has lots of places where it will insert calls to libm directly, not switching stacks.

One of places that I recall seeing this before is the translation of the fmod instruction. Rust has floating point modulus and presumably it is doing it in the red zone.

@brson
Copy link
Contributor Author

brson commented Apr 4, 2013

We can solve this with an fmod lang item.

@auroranockert
Copy link
Contributor

Is this an issue with calls to compiler-rt too? Or are they compiled in some special way to avoid the issue?

@catamorphism
Copy link
Contributor

Nominating for milestone 5, production-ready

@thestinger
Copy link
Contributor

memcpy, memmove, memset and memcmp are also all generated. As far as I can tell, we can't prevent it from generating these by altering the IR we output.

@graydon
Copy link
Contributor

graydon commented Aug 15, 2013

We can possibly be selective about when we emit memcpy/memmov, second guessing LLVM (like, never for big things)

@graydon
Copy link
Contributor

graydon commented Aug 15, 2013

accepted for production-ready milestone

@alexcrichton
Copy link
Member

Closing due to segmented stacks being gone (stack switches no longer a thing)

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 23, 2020
if_same_then_else: don't assume multiplication is always commutative

changelog: Don't assume multiplication is always commutative in [`if_same_then_else`]

Fixes rust-lang#5698
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

6 participants