From patchwork Wed Jan 30 19:11:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1033736 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-494972-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="YNzqwysV"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="O4a6bK4K"; dkim-atps=neutral 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 43qXzw6t6Pz9sBb for ; Thu, 31 Jan 2019 06:12:10 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:references:in-reply-to:from:date:message-id :subject:to:cc:content-type; q=dns; s=default; b=fDma0KZfVMRCfv/ yyvM8ipjyAw4hpuh7UgaFV6W2QFx6m2UDl+KaK8XeCcJH5XmFYMtN8D9Dp5Zoi9N w/2Mzu4xFOUXeHeUUj2zv3US7H9SS410dZByXWnFqQI0MnHIXO7gIdCYD890i/mK 1JJwJHMldy0V5RoW8sgdVjG8to0c= 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 :mime-version:references:in-reply-to:from:date:message-id :subject:to:cc:content-type; s=default; bh=ygkf345HB234U7JuGY/uW cH1i24=; b=YNzqwysVfkjkEx993O/zCT3ERZcLk27Lh8I5OR9HVDYK3BiM1rEAl Kk5OwPsU0g1f+HTzbYjcZ1nC9H9sjr57FbLT3yJW2/rcJ9pzRBsDix8NMj1awTEs FnNnAHY2RhVgLqlJOBSqdtXovH0tBIbobxntBONkMCja3Wui8orlfc= Received: (qmail 14037 invoked by alias); 30 Jan 2019 19:12:02 -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 14023 invoked by uid 89); 30 Jan 2019 19:12:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:CAFULd4, H*f:bHwP, H*i:G0A0, H*i:bHwP X-HELO: mail-it1-f182.google.com Received: from mail-it1-f182.google.com (HELO mail-it1-f182.google.com) (209.85.166.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Jan 2019 19:12:00 +0000 Received: by mail-it1-f182.google.com with SMTP id g85so37431ita.3; Wed, 30 Jan 2019 11:12:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Jowzx6PUMcaR8KDz3Nlp2HNa8mk1YONg7J3LdMw1w/U=; b=O4a6bK4KKDbt2VQo2OqelRjScyIg+ii9okLSk+UNvWHS2lnrzTNKehpv8iNHcH5hNL VtnRhsCztz7m+LNhZh0p0sejxZiECutc9SCEsd17LfQ2fuyzP3aUqh8nsF1Y5nJnXm05 d5VfDihieYWePSkTGxQsdr8W7Ly8tPzgReVqNaE3jLqXtdRIbsZQQcjC7m2cc0/NRRPT d8ei9fxeZVkoHfyZa49/YTIo7sNi7+mzY+CphkBl9fgd1/wHHr9vMZTbbK33KQmw2nxT nb684nOyzcRfvYI/0autm9jWGRi4XFM89Nwdh32wOd9pkXgpRXVedGBX01UzgvHNmvp6 iJ4g== MIME-Version: 1.0 References: <20190129202026.GC50653@troutmask.apl.washington.edu> In-Reply-To: From: Uros Bizjak Date: Wed, 30 Jan 2019 20:11:48 +0100 Message-ID: Subject: [PATCH, fortran ieee]: PR 88678, Many gfortran.dg/ieee/ieee_X.f90 test cases fail starting with r267465 To: Steve Kargl Cc: "gcc-patches@gcc.gnu.org" , Fortran List , Peter Bergner On Wed, Jan 30, 2019 at 10:37 AM Uros Bizjak wrote: > > Your decription suggests that this fixes PR fortran/88678. > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88678 > > Actually, additional patch is needed to fully fix PR88678. > support_fpu_trap enables and disables exceptions and this may fire > spurious exceptions. Just assume that all supported flags can generate > exceptions, as is done in the additional patch, posted to PR88678. The remaining ieee_*.f90 tests and large_1.f90 test failures on powerpc64 are fixed by the attached patch. 2019-01-30 Uroš Bizjak PR fortran/88678 * config/fpu-glibc.h (support_fpu_trap): Do not try to enable exceptions to determine if exception is supported. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32} (with appropriate config.host tweak to select fpu-glibc.header), alphaev68-linux-gnu and as reported in the PR, on powerpc64le-linux-gnu by Peter. OK for mainline? Uros. diff --git a/libgfortran/config/fpu-glibc.h b/libgfortran/config/fpu-glibc.h index c24bb6cbcd92..df2588e038d8 100644 --- a/libgfortran/config/fpu-glibc.h +++ b/libgfortran/config/fpu-glibc.h @@ -121,41 +129,7 @@ get_fpu_trap_exceptions (void) int support_fpu_trap (int flag) { - int exceptions = 0; - int old; - - if (!support_fpu_flag (flag)) - return 0; - -#ifdef FE_INVALID - if (flag & GFC_FPE_INVALID) exceptions |= FE_INVALID; -#endif - -#ifdef FE_DIVBYZERO - if (flag & GFC_FPE_ZERO) exceptions |= FE_DIVBYZERO; -#endif - -#ifdef FE_OVERFLOW - if (flag & GFC_FPE_OVERFLOW) exceptions |= FE_OVERFLOW; -#endif - -#ifdef FE_UNDERFLOW - if (flag & GFC_FPE_UNDERFLOW) exceptions |= FE_UNDERFLOW; -#endif - -#ifdef FE_DENORMAL - if (flag & GFC_FPE_DENORMAL) exceptions |= FE_DENORMAL; -#endif - -#ifdef FE_INEXACT - if (flag & GFC_FPE_INEXACT) exceptions |= FE_INEXACT; -#endif - - old = feenableexcept (exceptions); - if (old == -1) - return 0; - fedisableexcept (exceptions & ~old); - return 1; + return support_fpu_flag (flag); }