Skip to content

Commit

Permalink
add D71443 to patch set
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Apr 15, 2020
1 parent 4acd512 commit 3d7ffdc
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions deps/llvm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ $(eval $(call LLVM_PATCH,llvm-8.0-D66657-codegen-degenerate)) # remove for 10.0
$(eval $(call LLVM_PATCH,llvm-8.0-D71495-vectorize-freduce)) # remove for 10.0
$(eval $(call LLVM_PATCH,llvm-D75072-SCEV-add-type))
$(eval $(call LLVM_PATCH,llvm-9.0-D65174-limit-merge-stores)) # remove for 10.0
$(eval $(call LLVM_PATCH,llvm9-D71443-PPC-MC-redef-symbol)) # remove for 10.0
endif # LLVM_VER 9.0

ifeq ($(LLVM_VER_SHORT),10.0)
Expand Down
47 changes: 47 additions & 0 deletions deps/patches/llvm9-D71443-PPC-MC-redef-symbol.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
From 5cd52dbfa9c60cfd12676924bed97701ee9bc4ef Mon Sep 17 00:00:00 2001
From: Fangrui Song <[email protected]>
Date: Thu, 12 Dec 2019 16:18:57 -0800
Subject: [PATCH] [MC][PowerPC] Fix a crash when redefining a symbol after .set

Fix PR44284. This is probably not valid assembly but we should not crash.

Reviewed By: luporl, #powerpc, steven.zhang

Differential Revision: https://reviews.llvm.org/D71443

(cherry picked from commit f99eedeb72644671cd584f48e4c136d47f6b0020)
---
llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp | 3 ++-
llvm/test/MC/PowerPC/ppc64-localentry-symbols.s | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
index 90c3c8d20ed..71f926c265e 100644
--- llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
+++ llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
@@ -196,7 +196,8 @@ public:

void finish() override {
for (auto *Sym : UpdateOther)
- copyLocalEntry(Sym, Sym->getVariableValue());
+ if (Sym->isVariable())
+ copyLocalEntry(Sym, Sym->getVariableValue());
}

private:
diff --git llvm/test/MC/PowerPC/ppc64-localentry-symbols.s llvm/test/MC/PowerPC/ppc64-localentry-symbols.s
index f1d5c5d0ab1..a663af57ad4 100644
--- llvm/test/MC/PowerPC/ppc64-localentry-symbols.s
+++ llvm/test/MC/PowerPC/ppc64-localentry-symbols.s
@@ -32,3 +32,8 @@ func:
nop
nop
.localentry func, 8
+
+## PR44284 Don't crash if err is redefined after .set
+.set err, _err
+.globl err
+err:
--
2.26.0

0 comments on commit 3d7ffdc

Please sign in to comment.