rust-lang / rust-lang/rust

Wrong alignment for m68k pointer types

Open
#117,252 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-layout C-bug O-motorola68k
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

I'm working on making the libcore tests pass for m68k on rustc_codegen_gcc.

It looks like LLVM rust uses the SysV ABI for m68k, but it says the alignment for pointer types is 2, while this doc says it should be 4.

Also, this test fails.

It also says the alignment of usize/isize is 2.

cc @glaubitz

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 the linked m68k ABI documentation and the failing library/core/tests/ptr.rs test around line 720; compare the reported pointer and usize/isize alignments with rustc's m68k target handling. Done means the alignment matches the ABI and the linked core pointer test passes, including when checking rustc_codegen_gcc.

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
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.