Skip to content

Possible ARM bug #701

Open
Open
@FractalFir

Description

@FractalFir

This program behaves differently with optimizations enabled on ARM:

use core::ffi::*;
extern "C" {
    pub fn printf(format: *const c_char, ...) -> c_int;
}
fn dump_var(val3: f32) {
    if val3 != 1902660900.0 {
        unsafe { printf(b"wrong\n\0".as_ptr() as *const _) };
    }
}
fn main() {
    let mut _9 = 43619u128;
    let _64 = &mut _9;
    let _27 = _9 as f32;
    let _29 = 43619.0 * _27;
    dump_var(_29 + 43619.0)
}
Unoptimized: 

Optimized:
wrong

(I am using printf here to make porting the code to C easier)

Metadata

Metadata

Assignees

No one assigned

    Labels

    armIssues specific to the ARM targetbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions