From patchwork Fri Sep 12 22:27:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 388820 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 21EFC14010F for ; Sat, 13 Sep 2014 08:29:24 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=ALOVmWq6HFrW u/rKo89KOoglzgTpdVinGHBf/vWbAzWs2eUO0PXy5DerB4G49lBPapUcW/vlmkOG +7/MbwnSv8oYANTjHBvsMisBncJQdYFH7iw6yChZ852Y/CQqkX6AQ6obSQP7Iaus I6BUOdQBPOG1YrRQcCaB2AxM4LpiqSk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=q1RxndCRQ6AJi3Ui7g YmMmMRFDo=; b=e2ZJcwJ7tWZI7zx7UoiQ7dX0XZHgHv5R4gxymy2UzgYpkE5m/6 7tp5Cg7elZcvpva75dvYrLpZC9bSIrfDqHWmmQhgGNDOIiLrZ/KloxcpsNvE4Gnt KBhWdIiFy4F2GYSD3E3QVah3z2O5cJ2wYdxxZL/yJnTOQUQS0t5mQOtZQ= Received: (qmail 2798 invoked by alias); 12 Sep 2014 22:29:17 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 2785 invoked by uid 89); 12 Sep 2014 22:29:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mga11.intel.com Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Sep 2014 22:29:15 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 12 Sep 2014 15:29:14 -0700 X-ExtLoop1: 1 Received: from laut.jf.intel.com (HELO localhost) ([10.23.232.44]) by fmsmga002.fm.intel.com with ESMTP; 12 Sep 2014 15:28:48 -0700 Received: by localhost (Postfix, from userid 1000) id 3CB1D124DA7; Sat, 13 Sep 2014 00:27:51 +0200 (CEST) From: Andi Kleen To: gcc-patches@gcc.gnu.org Cc: Andi Kleen Subject: [PATCH] Work around miscompilation with 4.8.1 Date: Sat, 13 Sep 2014 00:27:48 +0200 Message-Id: <1410560868-11154-1-git-send-email-andi@firstfloor.org> From: Andi Kleen When compiling on opensuse 13.1, with a 4.8.1 based host compiler and --disable-bootstrap, the generated compiler always ICEs while compiling __builtin_cpu_supports in the cilk runtime library. The problem is fixed with later 4.8 releases, but at least still happens with the opensuse compiler. The cilk library already had a fallback path for this function for other compilers. Just use the fallback path when __SSE2_MATH__ is set. This makes it work on x86_64 systems with the buggy 4.8.1 at least, if multilib is forced to SSE. libcilkrts/: 2014-09-12 Andi Kleen PR bootstrap/63235 * runtime/config/x86/os-unix-sysdep.c (__builtin_cpu_supports): Use fallback when __SSE2_MATH__ is set. --- libcilkrts/runtime/config/x86/os-unix-sysdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcilkrts/runtime/config/x86/os-unix-sysdep.c b/libcilkrts/runtime/config/x86/os-unix-sysdep.c index b505ddf..344c31a 100644 --- a/libcilkrts/runtime/config/x86/os-unix-sysdep.c +++ b/libcilkrts/runtime/config/x86/os-unix-sysdep.c @@ -96,7 +96,7 @@ COMMON_SYSDEP int __cilkrts_xchg(volatile int *ptr, int x) * This declaration should generate an error when the Intel compiler adds * supprt for the intrinsic. */ -#ifdef __INTEL_COMPILER +#if defined(__INTEL_COMPILER) || defined(__SSE2_MATH__) static inline int __builtin_cpu_supports(const char *feature) { return 1;