[llvm-branch-commits] [cfe-branch] r222690 - Merging r217147:

Daniel Sanders daniel.sanders at imgtec.com
Mon Nov 24 13:30:06 PST 2014


Author: dsanders
Date: Mon Nov 24 15:30:06 2014
New Revision: 222690

URL: http://llvm.org/viewvc/llvm-project?rev=222690&view=rev
Log:
Merging r217147:
------------------------------------------------------------------------
r217147 | dsanders | 2014-09-04 14:28:14 +0100 (Thu, 04 Sep 2014) | 18 lines

[mips] Zero-sized structs cannot be ignored in MipsABIInfo::classifyReturnType() for O32

Summary:
They are returned indirectly which causes the other arguments to move to
the next argument slot.

With this, utils/ABITest does not discover any failing cases in the first
500 attempts on big/little endian for O32. Previously some of these failed.
Also tested N32/N64 little endian (big endian has other known issues) with
no issues.

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: atanasyan, cfe-commits

Differential Revision: http://reviews.llvm.org/D4811
------------------------------------------------------------------------

Added:
    cfe/branches/release_35/test/CodeGen/mips-zero-sized-struct.c
      - copied unchanged from r217147, cfe/trunk/test/CodeGen/mips-zero-sized-struct.c
Modified:
    cfe/branches/release_35/   (props changed)
    cfe/branches/release_35/lib/CodeGen/TargetInfo.cpp

Propchange: cfe/branches/release_35/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 24 15:30:06 2014
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:213609,213611,213613,213741,213834,213840,213902,213912-213913,213993,213998-213999,214008,214025,214050,214060,214119,214208,214222,214369,214390,214471,214662,214734-214735,214777,215046,215229,215245,215609,215618,215806-215808,216531,216572,216619,220874
+/cfe/trunk:213609,213611,213613,213741,213834,213840,213902,213912-213913,213993,213998-213999,214008,214025,214050,214060,214119,214208,214222,214369,214390,214471,214662,214734-214735,214777,215046,215229,215245,215609,215618,215806-215808,216531,216572,216619,217147,220874
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_35/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_35/lib/CodeGen/TargetInfo.cpp?rev=222690&r1=222689&r2=222690&view=diff
==============================================================================
--- cfe/branches/release_35/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/branches/release_35/lib/CodeGen/TargetInfo.cpp Mon Nov 24 15:30:06 2014
@@ -5506,7 +5506,12 @@ MipsABIInfo::returnAggregateInRegs(QualT
 ABIArgInfo MipsABIInfo::classifyReturnType(QualType RetTy) const {
   uint64_t Size = getContext().getTypeSize(RetTy);
 
-  if (RetTy->isVoidType() || Size == 0)
+  if (RetTy->isVoidType())
+    return ABIArgInfo::getIgnore();
+
+  // O32 doesn't treat zero-sized structs differently from other structs.
+  // However, N32/N64 ignores zero sized return values.
+  if (!IsO32 && Size == 0)
     return ABIArgInfo::getIgnore();
 
   if (isAggregateTypeForABI(RetTy) || RetTy->isVectorType()) {





More information about the llvm-branch-commits mailing list