[llvm-branch-commits] [llvm-branch] r324087 - Merging r323536:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Feb 2 05:47:07 PST 2018
Author: hans
Date: Fri Feb 2 05:47:07 2018
New Revision: 324087
URL: http://llvm.org/viewvc/llvm-project?rev=324087&view=rev
Log:
Merging r323536:
------------------------------------------------------------------------
r323536 | arichardson | 2018-01-26 16:56:14 +0100 (Fri, 26 Jan 2018) | 11 lines
[MIPS] Don't crash on unsized extern types with -mgpopt
Summary: This fixes an assertion when building the FreeBSD MIPS64 kernel.
Reviewers: atanasyan, sdardis, emaste
Reviewed By: sdardis
Subscribers: krytarowski, llvm-commits
Differential Revision: https://reviews.llvm.org/D42571
------------------------------------------------------------------------
Added:
llvm/branches/release_60/test/CodeGen/Mips/unsized-global.ll
- copied unchanged from r323536, llvm/trunk/test/CodeGen/Mips/unsized-global.ll
Modified:
llvm/branches/release_60/ (props changed)
llvm/branches/release_60/lib/Target/Mips/MipsTargetObjectFile.cpp
Propchange: llvm/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Feb 2 05:47:07 2018
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,321751,321789,321791,321806,321862,321870,321872,321878,321980,321991,321993-321994,322003,322016,322053,322056,322103,322106,322108,322123,322131,322223,322272,322313,322372,322473,322623,322644,322724,322767,322875,322878-322879,322900,322904-322905,322973,322993,323034,323155,323190,323307,323331,323355,323369,323371,323384,323469,323515,323582,323671-323672,323706,323710,323759,323781,323810-323811,323813,323857,323915
+/llvm/trunk:155241,321751,321789,321791,321806,321862,321870,321872,321878,321980,321991,321993-321994,322003,322016,322053,322056,322103,322106,322108,322123,322131,322223,322272,322313,322372,322473,322623,322644,322724,322767,322875,322878-322879,322900,322904-322905,322973,322993,323034,323155,323190,323307,323331,323355,323369,323371,323384,323469,323515,323536,323582,323671-323672,323706,323710,323759,323781,323810-323811,323813,323857,323915
Modified: llvm/branches/release_60/lib/Target/Mips/MipsTargetObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_60/lib/Target/Mips/MipsTargetObjectFile.cpp?rev=324087&r1=324086&r2=324087&view=diff
==============================================================================
--- llvm/branches/release_60/lib/Target/Mips/MipsTargetObjectFile.cpp (original)
+++ llvm/branches/release_60/lib/Target/Mips/MipsTargetObjectFile.cpp Fri Feb 2 05:47:07 2018
@@ -136,6 +136,13 @@ IsGlobalInSmallSectionImpl(const GlobalO
return false;
Type *Ty = GVA->getValueType();
+
+ // It is possible that the type of the global is unsized, i.e. a declaration
+ // of a extern struct. In this case don't presume it is in the small data
+ // section. This happens e.g. when building the FreeBSD kernel.
+ if (!Ty->isSized())
+ return false;
+
return IsInSmallSection(
GVA->getParent()->getDataLayout().getTypeAllocSize(Ty));
}
More information about the llvm-branch-commits
mailing list