[PATCH] D33975: [MachO] Fix codegen of alias of alias.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 19:19:35 PDT 2017


pcc added a comment.

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 https://reviews.llvm.org/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 :(



================
Comment at: lib/MC/MCExpr.cpp:660
           return true;
+        if (Res.getConstant() == 0 && (!A || !B))
+          return true;
----------------
Please add a comment explaining what this is for.


================
Comment at: test/CodeGen/X86/macho-alias-of-alias.ll:1
+; RUN: llc -filetype=obj < %s
+; PR33316
----------------
Can you convert this to a .s and move to test/MC?


Repository:
  rL LLVM

https://reviews.llvm.org/D33975





More information about the llvm-commits mailing list