[PATCH] D54016: [X86] don't allow X86_64 PIC mode addresses to be used as immediates

Yeoul Na via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 1 17:34:20 PDT 2018


rapidsna created this revision.
Herald added a subscriber: llvm-commits.

This fixes https://bugs.llvm.org/show_bug.cgi?id=39525


Repository:
  rL LLVM

https://reviews.llvm.org/D54016

Files:
  lib/Target/X86/X86ISelLowering.cpp


Index: lib/Target/X86/X86ISelLowering.cpp
===================================================================
--- lib/Target/X86/X86ISelLowering.cpp
+++ lib/Target/X86/X86ISelLowering.cpp
@@ -41119,7 +41119,8 @@
     // In any sort of PIC mode addresses need to be computed at runtime by
     // adding in a register or some sort of table lookup.  These can't
     // be used as immediates.
-    if (Subtarget.isPICStyleGOT() || Subtarget.isPICStyleStubPIC())
+    if (Subtarget.isPICStyleGOT() || Subtarget.isPICStyleStubPIC() ||
+        Subtarget.isPICStyleRIPRel())
       return;
 
     // If we are in non-pic codegen mode, we allow the address of a global (with


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54016.172278.patch
Type: text/x-patch
Size: 669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181102/81a7e2ac/attachment.bin>


More information about the llvm-commits mailing list