Skip to content

Unaligned load/store regression - ARMv5 incorrect codegen #32289

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
arcnmx opened this issue Mar 16, 2016 · 13 comments
Closed

Unaligned load/store regression - ARMv5 incorrect codegen #32289

arcnmx opened this issue Mar 16, 2016 · 13 comments

Comments

@arcnmx
Copy link
Contributor

arcnmx commented Mar 16, 2016

#23431 is back, the test case from that issue now miscompiles on ARMv5 again. This broke somewhere between the Jan 3rd and March 9th nightlies.

main.rs and main.ll

@arcnmx
Copy link
Contributor Author

arcnmx commented Mar 16, 2016

CC @dotdash - you identified and fixed this issue the last time it came up, any ideas about what changed recently that brought it back?

@dotdash
Copy link
Contributor

dotdash commented Mar 16, 2016

No idea. A cursory glance at the IR doesn't show up any missing alignment specifiers either.

@arcnmx
Copy link
Contributor Author

arcnmx commented Mar 16, 2016

main.ll from old nightly + diff

The bizarre thing is that I don't see any real differences besides the identifier hashes in that diff... That nightly does indeed generate a working binary though. Function attribute differences? These are both opt-level=3 lto. Should I compare the asm I guess?

EDIT: less noisy IR diff

@arcnmx
Copy link
Contributor Author

arcnmx commented Mar 16, 2016

Generated asm from both + diff: http://pastie.org/private/j5onpivq1disqrrnwy9pq

@arcnmx
Copy link
Contributor Author

arcnmx commented Mar 16, 2016

Okay, I've bisected across rustc versions...

Nightly 2016-01-30 303892ee1 works, 2016-01-31 9a07087bc is broken.

303892e...9a07087 ... and I see no changes to trans at all there ;_;

@joerg-krause
Copy link
Contributor

@arcnmx Are you using a custom JSON target file for ARMv5?

@arcnmx
Copy link
Contributor Author

arcnmx commented Mar 16, 2016

@joerg-krause yeah, there's no built-in target for it in rustc.

@arcnmx
Copy link
Contributor Author

arcnmx commented Mar 16, 2016

Okay I appear to have messed up... It's actually jan 28 vs 30 (there is no 29 nightly): 38e23e8...303892e

@joerg-krause
Copy link
Contributor

The issue you describe is about faulty data alignment. You have to tell LLVM to compile with strict-align option:

"features": "+v5te,+dsp,+soft-float,+strict-align,-crypto,-neon"

Have a look at my armv5te-unknown-linux-gnueabi for comparison.

@joerg-krause
Copy link
Contributor

Note, you'll have to recompile the rust libs after changing the target configuration.

@arcnmx
Copy link
Contributor Author

arcnmx commented Mar 16, 2016

@joerg-krause makes sense, thanks! Especially alongside the LLVM version update in the commit range I linked. Will try and report back.

@joerg-krause
Copy link
Contributor

For the record, this issue #31796 was related to faulty data alignment, too.

@arcnmx
Copy link
Contributor Author

arcnmx commented Mar 16, 2016

Yup, that seems to help, thanks! strict-align seems to be a new target feature in the updated LLVM... and of course they helpfully removed the logic that used to infer it from the CPU architecture...

@arcnmx arcnmx closed this as completed Mar 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants