int: implement signed comparison for unsigned integers#931
Conversation
|
Let me know if you'd like me to open an issue in the I have a few other minor fixes, and I can send PRs with them once I know how you'd prefer them formatted. |
No need to open an issue: you can open a PR right away.
Anything else you need to know about my preferences here? Thanks for your contribution! |
bc6d978 to
5c533bc
Compare
|
That should be it. Now I know how to add and run tests, I can use that to make sure the changes I push actually fix things. There are a few bigger changes I've accumulated (LTO improvements, link section fixes, clobber support), and a couple of them require patches to gcc (and consequently |
0f0cfa0 to
feab042
Compare
|
Hmm... The test doesn't seem to work without int128. Or on m68k. Think that is a real bug, or should I gate the test on x86 only? |
It seems like a real bug to me. which means it seems you try to cast a low/high value to the complete 128-bit representation (which is an array of i64). |
feab042 to
2a023ce
Compare
|
Yep, sorry, I just needed to figure out how to use Hopefully works now. So happy CI and test coverage exists. |
Implement signed comparison for unsigned integers, which is very similar to unsigned integers but uses `to_signed()` rather than `to_unsigned()`. This fixes a case where niche optimization causes the discriminant to sometimes compare signed and unsigned values. Signed-off-by: Sean Cross <sean@xobs.io>
2a023ce to
f5dc6be
Compare
|
Thanks for your contribution! |
Implement signed comparison for unsigned integers, which is very similar to unsigned integers but uses
to_signed()rather thanto_unsigned(). This fixes a case where niche optimization causes the discriminant to sometimes compare signed and unsigned values.This was caught when running a test suite for an embedded device compiled under the gcc backend. A reproducer when compiling under -O for x86-64 is:
The problem only shows up with
-O, not by default.