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

Weird behavior with 1.63.0.2 on ESP32 with debug builds #135

Closed
bjoernQ opened this issue Aug 25, 2022 · 2 comments
Closed

Weird behavior with 1.63.0.2 on ESP32 with debug builds #135

bjoernQ opened this issue Aug 25, 2022 · 2 comments
Milestone

Comments

@bjoernQ
Copy link

bjoernQ commented Aug 25, 2022

The code in https://github.com/bjoernQ/miscompile prints 26.608885 when compiled in release mode on 1.63.0.2 but prints 0.015625 when compiled in debug mode.

Also, on 1.63.0.1 (and 1.63) it prints the correct 26.608885 in debug and release mode.

@bjoernQ
Copy link
Author

bjoernQ commented Aug 26, 2022

It is even reproducible with much less code:

...

    let foo = do_foo(3.14f64);
    let foo = foo as f32;
    println!("it is {}", foo);

    loop {}
}

#[inline(never)]
fn do_foo(param: f64) -> f64 {
    param * 2f64 / 3f64
}

This gives me 2.020576 (this seems to change randomly) on 1.63.0.2 debug but the correct 2.0933332 in release - always correct for 1.63

If I change to #[inline(always)] it calculates the correct value

@MabezDev MabezDev added this to the 1.64.0.0 milestone Sep 20, 2022
@MabezDev
Copy link
Member

This should now be fixed by the 1.64.0.0 release.

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

2 participants