This is an archive of the discontinued LLVM Phabricator instance.

[PATCH] Avoid the use of signed to unsigned integer conversion implementation-defined behavior
AbandonedPublic

Authored by avieira on Jan 23 2017, 3:50 AM.

Details

Summary

Hello,

This patch is a one-line change to avoid using implementation-defined behavior to check whether the MSB bit of Alignment is set in MachineConstantPool.

Can someone commit this please?

Cheers,
Andre

Diff Detail

Event Timeline

avieira created this revision.Jan 23 2017, 3:50 AM

Looks fine to me but probably someone else should also need to have a look. Could you add a small test, if possible.

Euhm, what sort of test would you propose?

rengolin edited edge metadata.

I'm not a language lawyer. Adding some more people that know the standard much better than I do.

rnk edited edge metadata.Feb 1 2017, 1:58 PM

What problem does this solve? I'm pretty sure LLVM does not run on ones' complement machines. The comparison against zero is "more canonical" in LLVM IR anyway.

avieira abandoned this revision.Mar 14 2017, 7:48 AM

OK, I just thought having it rely on implementation defined behavior wasn't very nice. Though I do agree it is not a big deal in this case...

I'll drop this. (Hoping thats what "abandon revision" means.