From 11ca34818ad9a982f653cfd727f1b7d677efa9a9 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 2 Jul 2014 15:50:53 -0700 Subject: Work around ICC optimizer bug hoisting conditions out of the loop In the first iteration of the loop, span->objects is not null, but becomes null and therefore the entry is removed from the list. When the list is empty, the list header (nonempty_) has next == prev == self and objects is null. So in the second iteration, DLL_IsEmpty should return true. Analysis of the assembly output indicates that the function DLL_IsEmpty (DLL = "doubly linked list") was hoisted out of the loop and its condition was never checked again. Affects: 14.0.3 on Linux, 15 on OS X (EDG and Clang) and Linux Does not affect: 14.0.3 on Windows Intel issue ID: 6000056746 Change-Id: I4439f441d5206a39391b9181baf42160d37bd2f1 Reviewed-by: Simon Hausmann --- src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp index d95f078..14b7d76 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp @@ -2635,8 +2635,11 @@ void* TCMalloc_Central_FreeList::FetchFromSpansSafe() { } void* TCMalloc_Central_FreeList::FetchFromSpans() { - if (DLL_IsEmpty(&nonempty_)) return NULL; +// Intel compiler bug; issue id 6000056746 +// if (DLL_IsEmpty(&nonempty_)) return NULL; Span* span = nonempty_.next; + if (span == &nonempty_) + return NULL; ASSERT(span->objects != NULL); ASSERT_SPAN_COMMITTED(span); -- cgit v1.2.1