rust-lang / rust-lang/rustc_codegen_gcc

Cast from u128 to f32 is broken in release mode

Open
#705 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
1.2k
Forks
105
Avg merge
8h 20m
Merged PRs (30d)
14

Description

The test tests/ui/numbers-arithmetic/u128-as-f32.rs was disabled in bb3ee766cabf3997a056cdef1ff3087f5f2fe3eb.

This used to work with GCC version b8f4bbf1b995d9511bad6652e8d774620b2bd833 , but with the rebase to GCC 3e3878e7183f1d1e1ccf5aba99da7fbb36c012c8, this test now fails when compiled in release mode.

Something weird is that if I print the f32 value, the test passes.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/ui/numbers-arithmetic/u128-as-f32.rs and reproduce its failure in release mode, comparing behavior with and without printing the f32 value. Review the change that disabled the test and the GCC rebase from b8f4bbf1b995d9511bad6652e8d774620b2bd833 to 3e3878e7183f1d1e1ccf5aba99da7fbb36c012c8. Done means the cast test passes in release mode and can be enabled again.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.