OSDN Git Service

[ARM] halfword store hits llvm_unreachable with big-endian
authorSimon Wallis <simon.wallis2@arm.com>
Fri, 17 Jul 2020 07:26:30 +0000 (08:26 +0100)
committerSimon Wallis <simon.wallis2@arm.com>
Fri, 17 Jul 2020 07:56:44 +0000 (08:56 +0100)
Summary:
[ARM] halfword store hits llvm_unreachable with big-endian

Provide missing case in getFixupKindContainerSizeBytes().

This stops execution reaching llvm_unreachable("Unknown fixup kind!")

D83947

Reviewers: olista01, ostannard

Reviewed By: ostannard

Subscribers: ostannard, kristof.beyls, hiraditya, danielkiss, llvm-commits

Tags: #llvm

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

Change-Id: I598aa1fb51fd1c6f424c557c85d6df6d1958bc62

llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
llvm/test/CodeGen/ARM/store_half.ll [new file with mode: 0644]

index 9ad595c..b02aef3 100644 (file)
@@ -1010,6 +1010,7 @@ static unsigned getFixupKindContainerSizeBytes(unsigned Kind) {
   case ARM::fixup_t2_condbranch:
   case ARM::fixup_t2_uncondbranch:
   case ARM::fixup_t2_pcrel_10:
+  case ARM::fixup_t2_pcrel_9:
   case ARM::fixup_t2_adr_pcrel_12:
   case ARM::fixup_arm_thumb_bl:
   case ARM::fixup_arm_thumb_blx:
diff --git a/llvm/test/CodeGen/ARM/store_half.ll b/llvm/test/CodeGen/ARM/store_half.ll
new file mode 100644 (file)
index 0000000..c182f9c
--- /dev/null
@@ -0,0 +1,9 @@
+; RUN: llc < %s -mtriple=thumbebv8.2a-arm-none-eabi -mattr=+fullfp16 -filetype=obj -o /dev/null
+; RUN: llc < %s -mtriple=thumbv8.2a-arm-none-eabi -mattr=+fullfp16 -filetype=obj -o /dev/null
+; RUN: llc < %s -mtriple=armebv8.2a-arm-none-eabi -mattr=+fullfp16 -filetype=obj -o /dev/null
+; RUN: llc < %s -mtriple=armv8.2a-arm-none-eabi -mattr=+fullfp16 -filetype=obj -o /dev/null
+
+define void @woah(half* %waythere) {
+  store half 0xHE110, half* %waythere
+  ret void
+}