From patchwork Fri Feb 20 18:07:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 442101 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 89710140161 for ; Sat, 21 Feb 2015 05:08:44 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=mZ20eufACLmo9Ilh1ayabk/OAiZ8w JN1qaucHZbMdZlVEumlJkGDchRzN9+qZu1x09hsuvQ5OhclYEPT8zNNOvUB40000 9fxjKBaoeaXiw1d3KMtJlny5k70Ek5P990uRNW2j4OmI9NcQ4MN8tch5oXwvO8Wq /DrptmCZvB6hAw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=oUTQb3jJQjbQPynbSHs8mwVzaYc=; b=b0p wsU3punDaCEai2uxkCtH3LoTvdyIhbNJXcv8vXV0kNsl/2iV9WFtsqM0XFqRSjTh v1O2Q5Dr0BA8tI/k3488wHXKArVBHFnjrrdBhLVjMFWhnrQS1g5qxX7KCusnkBGL JQWJjfUuWmP9DkuT+Fo68q9XJflDOkV7ESslGV6A= Received: (qmail 3628 invoked by alias); 20 Feb 2015 18:08:01 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 3564 invoked by uid 89); 20 Feb 2015 18:08:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Fri, 20 Feb 2015 18:07:53 +0000 From: Joseph Myers To: Subject: soft-fp: Adjust call to abort for kernel use [committed] Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 soft-fp calls abort in various cases that the code doesn't handle, all cases that should never actually occur for any supported choice of types. Calling an abort function is not appropriate for kernel use, so the Linux kernel redefines abort as a macro in various ways in the ports using this code, typically to "return 0" or similar. One use of abort in soft-fp is inside a comma expression and doesn't work with such a macro. This patch changes it to use a statement expression. Tested for powerpc-nofpu that installed shared libraries are unchanged by this patch. Committed. (There are two classes of aborts: those to make control flow visible to the compiler, in default cases of switches over _FP_CLS_COMBINE, which could reasonably change to __builtin_unreachable for glibc but would still need to handle pre-4.5 compilers for kernel use, and those intended to detect any use of soft-fp for combinations of types the code doesn't know how to handle, which could reasonably become link failures if the calls should always be optimized away. But those are separate possible future enhancements.) 2015-02-20 Joseph Myers * soft-fp/op-common.h (_FP_FROM_INT): Wrap call to abort in expression inside statement expression. diff --git a/soft-fp/op-common.h b/soft-fp/op-common.h index 342532a..14fd6cd 100644 --- a/soft-fp/op-common.h +++ b/soft-fp/op-common.h @@ -1815,7 +1815,7 @@ X##_e = (_FP_EXPBIAS_##fs + 2 * _FP_W_TYPE_SIZE - 1 \ - _FP_FROM_INT_lz); \ }) \ - : (abort (), 0))); \ + : ({ abort (); 0; }))); \ \ if ((rsize) - 1 + _FP_EXPBIAS_##fs >= _FP_EXPMAX_##fs \ && X##_e >= _FP_EXPMAX_##fs) \