Repository: rust
Issue: rustc SIGSEGV compiling rug 1.24.1 crate on RISC-V Armbian 24.5.0
Labels: I-crash,O-riscv,C-discussion

<!--
Thank you for finding an Internal Compiler Error! 🧊  If possible, try to provide
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
-->

### Code

```Rust
[package]
name = "precisionTest"
version = "0.1.0"
edition = "2021"

[dependencies]
rug = "1.24.1"

use rug::{Assign, Float};

fn main() {
    // rust does not support 128-bit or larger floating point numbers natively
    // so we use the rug crate to simulate 128-bit and 256-bit floating point numbers
    // Define the precision for rug floating point vars
    let precision_128 = 128;
    let precision_256 = 256;

    let initial_value = 2.0 / 3.0;
    // Initialize floating point numbers
    
    let mut s23: f32 = initial_value; // Single precision (32-bit)
    let mut d23: f64 = initial_value as f64; // Double precision (64-bit)
    let mut q23 = Float::with_val(precision_128, initial_value);
    let mut e23 = Float::with_val(precision_256, initial_value);

    // Perform the first series of operations
    println!("Performing operations with initial values of 2/3");
    println!("{:<15} {:<20} {:<42} {:<20}", "s23 (f32)", "d23 (f64)", "q23 (rug float 128)", "e23 (rug float 256)");
    println!("{:<15} {:<20} {:<42} {:<20}", "---------", "---------", "---------", "---------");
    for _ in 1..=18 {
        s23 = s23 / 10.0 + 1.0;
        d23 = d23 / 10.0 + 1.0;
        q23 = q23 / 10.0 + 1.0;
        e23 = e23 / 10.0 + 1.0;
        println!("{:<15} {:<20} {:<42} {:<20}", s23, d23, q23, e23);
    }

    for _ in 1..=17 {
        s23 = (s23 - 1.0) * 10.0;
        d23 = (d23 - 1.0) * 10.0;
        q23 = (q23 - 1.0) * 10.0;
        e23 = (e23 - 1.0) * 10.0;
        println!("{:<15} {:<20} {:<42} {:<20}", s23, d23, q23, e23);
    }
}

```


### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.81.0-nightly (ba1d7f4a0 2024-06-29)
binary: rustc
commit-hash: ba1d7f4a083e6402679105115ded645512a7aea8
commit-date: 2024-06-29
host: riscv64gc-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7
```

### Error output

```
rich@bananapif3:~/rust/precisionTest$ cargo run
    Updating crates.io index
     Locking 16 packages to latest compatible versions
   Compiling gmp-mpfr-sys v1.6.4
   Compiling libc v0.2.155
   Compiling az v1.2.1
   Compiling libm v0.2.8
   Compiling rug v1.24.1
error: rustc interrupted by SIGSEGV, printing backtrace

/home/rich/.rustup/toolchains/nightly-riscv64gc-unknown-linux-gnu/bin/../lib/librustc_driver-b89e8be1f02fc7e1.so(+0xc5ce7c)[0x3f918eee7c]
linux-vdso.so.1(__vdso_rt_sigreturn+0x0)[0x3f9989c800]
/lib/riscv64-linux-gnu/libc.so.6(syscall+0x1c)[0x3f90aaae80]
/home/rich/.rustup/toolchains/nightly-riscv64gc-unknown-linux-gnu/bin/../lib/libstd-c9884c552aa40c8c.so(_ZN3std3sys4sync5mutex5futex5Mutex14lock_contended17ha8e3960d4d6da7beE+0x98)[0x3f90bbb342]
/home/rich/.rustup/toolchains/nightly-riscv64gc-unknown-linux-gnu/bin/../lib/libstd-c9884c552aa40c8c.so(_ZN3std3sys4sync7condvar5futex7Condvar4wait17h70cf2c3a001d1809E+0xaa)[0x3f90bfe9f6]
/home/rich/.rustup/toolchains/nightly-riscv64gc-unknown-linux-gnu/bin/../lib/librustc_driver-b89e8be1f02fc7e1.so(+0x5cf4dee)[0x3f96986dee]
/home/rich/.rustup/toolchains/nightly-riscv64gc-unknown-linux-gnu/bin/../lib/librustc_driver-b89e8be1f02fc7e1.so(+0x5cf5ba8)[0x3f96987ba8]
/home/rich/.rustup/toolchains/nightly-riscv64gc-unknown-linux-gnu/bin/../lib/librustc_driver-b89e8be1f02fc7e1.so(+0x5cf5bf8)[0x3f96987bf8]
/home/rich/.rustup/toolchains/nightly-riscv64gc-unknown-linux-gnu/bin/../lib/librustc_driver-b89e8be1f02fc7e1.so(+0x5cf62ba)[0x3f969882ba]
/home/rich/.rustup/toolchains/nightly-riscv64gc-unknown-linux-gnu/bin/../lib/librustc_driver-b89e8be1f02fc7e1.so(+0x5cf6c14)[0x3f96988c14]
/home/rich/.rustup/toolchains/nightly-riscv64gc-unknown-linux-gnu/bin/../lib/libstd-c9884c552aa40c8c.so(rust_metadata_std_7312307a1d21ac33+0x8623a)[0x3f90bfb23a]
/lib/riscv64-linux-gnu/libc.so.6(+0x710f4)[0x3f90a5a0f4]
/lib/riscv64-linux-gnu/libc.so.6(+0xc3908)[0x3f90aac908]

```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>

```
<backtrace>
```

</p>
</details>