[mips][micromips] Fix how values in .gcc_except_table are calculated
authorAleksandar Beserminji <abeserminji@wavecomp.com>
Tue, 16 Oct 2018 08:27:28 +0000 (08:27 +0000)
committerAleksandar Beserminji <abeserminji@wavecomp.com>
Tue, 16 Oct 2018 08:27:28 +0000 (08:27 +0000)
commita5949439ca6adbb3b19dbd599880ff5b239f964e
tree4be20376f56b291b1647ab57a8e16915b42beb28
parent8d56be707038f99cf4e387c2a9390d39bea287cc
[mips][micromips] Fix how values in .gcc_except_table are calculated

When a landing pad is calculated in a program that is compiled
for micromips, it will point to an even address. Such an error will
cause a segmentation fault, as the instructions in micromips are
aligned on odd addresses. This patch sets the last bit of the offset
where a landing pad is, to 1, which will effectively be
an odd address and point to the instruction exactly.

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

llvm-svn: 344591
llvm/include/llvm/MC/MCAsmBackend.h
llvm/lib/MC/MCExpr.cpp
llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp
llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.h
llvm/test/CodeGen/Mips/micromips-gcc-except-table.ll [new file with mode: 0644]