Author: hans Date: Fri Aug 3 03:20:21 2018 New Revision: 338845 URL: http://llvm.org/viewvc/llvm-project?rev=338845&view=rev Log: Merging r338749: ------------------------------------------------------------------------ r338749 | mstorsjo | 2018-08-02 20:12:08 +0200 (Thu, 02 Aug 2018) | 6 lines
Work around more GCC miscompiles exposed by r338464. This is the same fix as in r338478, for another occurrance of the same pattern from r338464. See gcc.gnu.org/PR86769 for details of the bug. ------------------------------------------------------------------------ Modified: cfe/branches/release_70/ (props changed) cfe/branches/release_70/lib/Sema/SemaInit.cpp Propchange: cfe/branches/release_70/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 3 03:20:21 2018 @@ -1,4 +1,4 @@ /cfe/branches/type-system-rewrite:134693-134817 -/cfe/trunk:338552-338553,338602 +/cfe/trunk:338552-338553,338602,338749 /cfe/trunk/test:170344 /cfe/trunk/test/SemaTemplate:126920 Modified: cfe/branches/release_70/lib/Sema/SemaInit.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_70/lib/Sema/SemaInit.cpp?rev=338845&r1=338844&r2=338845&view=diff ============================================================================== --- cfe/branches/release_70/lib/Sema/SemaInit.cpp (original) +++ cfe/branches/release_70/lib/Sema/SemaInit.cpp Fri Aug 3 03:20:21 2018 @@ -6371,8 +6371,12 @@ static bool implicitObjectParamIsLifetim const TypeSourceInfo *TSI = FD->getTypeSourceInfo(); if (!TSI) return false; + // Don't declare this variable in the second operand of the for-statement; + // GCC miscompiles that by ending its lifetime before evaluating the + // third operand. See gcc.gnu.org/PR86769. + AttributedTypeLoc ATL; for (TypeLoc TL = TSI->getTypeLoc(); - auto ATL = TL.getAsAdjusted<AttributedTypeLoc>(); + (ATL = TL.getAsAdjusted<AttributedTypeLoc>()); TL = ATL.getModifiedLoc()) { if (ATL.getAttrKind() == AttributedType::attr_lifetimebound) return true; _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits