Skip to content

We shouldn't use the host's uint for target sizes. #5172

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

Closed
jld opened this issue Feb 28, 2013 · 14 comments
Closed

We shouldn't use the host's uint for target sizes. #5172

jld opened this issue Feb 28, 2013 · 14 comments
Labels
A-codegen Area: Code generation E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@jld
Copy link
Contributor

jld commented Feb 28, 2013

It's unclear how likely we are to ever deal with ≥4GiB things (or possible things; e.g., if an mmapped region is cast to a huge fixed array type or something like that), let alone when cross-compiling from 32-bit to 64-bit, but this is probably something that should be cleaned up.

For comparison, LLVM seems to mostly use uint64_t for sizes; there are a few unsigneds but I think they may all be for cases like individual machine-level values where the sizes can't overflow.

@graydon
Copy link
Contributor

graydon commented Feb 28, 2013

Can you point out examples where this is happening? Just curious which instances you're referring to.

@jld
Copy link
Contributor Author

jld commented Mar 12, 2013

All the ll*size_of* in trans::machine, for one. T_array. There are probably more I'm not thinking of right now.

@pcwalton
Copy link
Contributor

I don't think this is backwards incompatible.

@emberian
Copy link
Member

emberian commented Aug 5, 2013

I think this is backwards incompatible. The size of uint changing depending on whether you compiled with a cross compiler or not is weird.

@thestinger
Copy link
Contributor

I don't think it has to do with the size of uint changing but rather the sizes used in the compiler.

@graydon
Copy link
Contributor

graydon commented Aug 8, 2013

just a bug, removing milestone/nomination.

@emberian
Copy link
Member

emberian commented Nov 4, 2013

This should be fairly easy to do. Just change uint to u64 as appropriate... in all of the places in trans.

@nathanielherman
Copy link
Contributor

Is this still wanted? I can tackle this if so. I presume we want to make align_of and element_offset stuff in trans::machine also return u64's instead of uint's?

nathanielherman added a commit to nathanielherman/rust that referenced this issue Jan 23, 2014
nathanielherman added a commit to nathanielherman/rust that referenced this issue Jan 30, 2014
nathanielherman added a commit to nathanielherman/rust that referenced this issue Jan 30, 2014
@alexcrichton
Copy link
Member

Closed by #11759, thanks @nathanielherman!

@eddyb
Copy link
Member

eddyb commented Mar 14, 2014

Found more issues:

// middle::trans::common:
pub fn C_int(ccx: &CrateContext, i: int) -> ValueRef {...}
pub fn C_uint(ccx: &CrateContext, i: uint) -> ValueRef {...}

These look like they would truncate values when cross-compiling from a 32-bit architecture to a 64-bit one.

@huonw huonw reopened this Mar 14, 2014
@errordeveloper
Copy link
Contributor

@huonw @eddyb is this still and issue and is anyone going to work on it?

@eddyb looks like the code you referred to is still there...

@frewsxcv
Copy link
Member

frewsxcv commented Jan 9, 2015

The code in question that @eddyb mentioned

@nagisa
Copy link
Member

nagisa commented Feb 28, 2015

The code in question now uses AsU64 and AsI64.

@steveklabnik
Copy link
Member

There's been a lot of ongoing work to move away from usize to specific sizes where it makes sense, so I don't think this ticket is particularly useful anymore.

bors added a commit to rust-lang-ci/rust that referenced this issue May 2, 2020
Improve deployment and documentation

**This should be merged shortly after** rust-lang#5172

This extracts the python code that generated the `versions.json` file and now sorts the versions. in addition to that it improves the order on the website, respecting the new `rust-*` directories.

The new appearance of the documentation site can be previewed here: https://flip1995.github.io/rust-clippy/

changelog: Add documentation for Clippy stable releases at https://rust-lang.github.io/rust-clippy/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests