This is an archive of the discontinued LLVM Phabricator instance.

[MachO] Fix codegen of alias of alias.
ClosedPublic

Authored by eugenis on Jun 6 2017, 6:15 PM.

Details

Reviewers
pcc
rafael
Summary

Fixes PR33316.

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis created this revision.Jun 6 2017, 6:15 PM
pcc edited edge metadata.Jun 6 2017, 7:19 PM

Looks like we will still crash if an alias that is referenced from an alias has a non-zero offset. Maybe that isn't so bad though, we should really be requiring aliases to be in canonical form (see D29781 and refs) in which case aliases of aliases would be invalid IR.

That wouldn't stop you from writing a .s that would crash MC, but unfortunately as far as I know it is already quite easy to crash MC right now :(

lib/MC/MCExpr.cpp
661

Please add a comment explaining what this is for.

test/CodeGen/X86/macho-alias-of-alias.ll
1 ↗(On Diff #101658)

Can you convert this to a .s and move to test/MC?

eugenis updated this revision to Diff 101818.Jun 7 2017, 2:50 PM
eugenis marked 2 inline comments as done.
pcc accepted this revision.Jun 7 2017, 2:58 PM

LGTM, but Rafael should take a look as well.

test/MC/MachO/alias.ll
1 ↗(On Diff #101818)

Rename to alias.s

6 ↗(On Diff #101818)

Maybe check that we are producing a correct relocation here.

This revision is now accepted and ready to land.Jun 7 2017, 2:58 PM
eugenis updated this revision to Diff 101822.Jun 7 2017, 3:06 PM
eugenis marked 2 inline comments as done.
eugenis closed this revision.Jun 8 2017, 1:51 PM

r305012