From patchwork Mon Jun 24 08:38:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 253733 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 373092C0426 for ; Mon, 24 Jun 2013 18:39:12 +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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=NL/AHwE0KKVi/H2x1 XD1EQ6fpIBXU7+QXnH+qGucJiBzeC2LGIGKaQuVZOEj2F+68cNPxu5IIylhWG23k MUFOKx0E46IuaU4i2jWvjsNpiiNc7qr94PTJCcQVYjaDRzl6mUR2Zw39bmZvKsuK wxuwtK+SY2WPsVQmXx1uplkrDI= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=yMn+VT39PGGYAag9Qzsyda4 o/oQ=; b=aHVEK0hqFRwsKEjsJZekuVsu/C7Q4wR3ir6ZZtu0k/KZuFxzet5QcZ9 TE/50+bEMT9JJsygbY0yXrGnLpp/T7yXDT6k+s8rXxUS4uG/zkJ1iwhJaWJHGzxF nVXbDldL3ynrYdwXy8fvbyZp1wb/DpBNUnHbk/ES0cMWyLqp9rys= Received: (qmail 448 invoked by alias); 24 Jun 2013 08:39:01 -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 406 invoked by uid 89); 24 Jun 2013 08:38:56 -0000 X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 24 Jun 2013 08:38:54 +0000 Received: from archimedes.net-b.de (port-92-206-14-23.dynamic.qsc.de [92.206.14.23]) by mx02.qsc.de (Postfix) with ESMTP id 7EB7324918; Mon, 24 Jun 2013 10:38:49 +0200 (CEST) Message-ID: <51C80599.7070108@net-b.de> Date: Mon, 24 Jun 2013 10:38:49 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: Eric Botcazou CC: Gerald Pfeifer , gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org, David Edelsohn , Uros Bizjak Subject: Re: [Patch, Fortran] Print floating-point exception status after STOP/ERROR STOP References: <51B8721A.6000000@net-b.de> <2737126.5b1v7aemIl@polaris> <2494409.3FinfxvR0z@polaris> <51C6256E.1020708@net-b.de> In-Reply-To: <51C6256E.1020708@net-b.de> X-Virus-Found: No Eric, Gerald, all, I have now committed (Rev. 200360) the attached patch. (Compared to the draft patch, with a missing "," added in AC_CHECK_TYPES). Eric, Gerald: Can you confirm that it now works on both FreeBSD and Solaris? Eric: Should one (conditionally) include on Solaris? I am asking because LIBGFOR_CHECK_FPSETMASK in acinclude.m4 uses that include file during configure - but libgfortran.h (or config/fpu-sysv.h) don't. Tobias Index: libgfortran/ChangeLog =================================================================== --- libgfortran/ChangeLog (Revision 200359) +++ libgfortran/ChangeLog (Arbeitskopie) @@ -1,3 +1,10 @@ +2013-06-24 Tobias Burnus + + * configure.ac: Check for fp_except and fp_except_t. + * config/fpu-sysv.h: Conditionally use either type. + * configure: Regenerate. + * config.h.in: Regenerate. + 2013-06-21 Eric Botcazou * config/fpu-sysv.h (get_fpu_except_flags): Fix typo. Index: libgfortran/config/fpu-sysv.h =================================================================== --- libgfortran/config/fpu-sysv.h (Revision 200359) +++ libgfortran/config/fpu-sysv.h (Arbeitskopie) @@ -85,7 +85,13 @@ int get_fpu_except_flags (void) { int result; +#if HAVE_FP_EXCEPT fp_except set_excepts; +#elif HAVE_FP_EXCEPT_T + fp_except_t set_excepts; +#else + choke me +#endif result = 0; set_excepts = fpgetsticky (); Index: libgfortran/config.h.in =================================================================== --- libgfortran/config.h.in (Revision 200359) +++ libgfortran/config.h.in (Arbeitskopie) @@ -405,6 +405,12 @@ /* fp_enable is present */ #undef HAVE_FP_ENABLE +/* Define to 1 if the system has the type `fp_except'. */ +#undef HAVE_FP_EXCEPT + +/* Define to 1 if the system has the type `fp_except_t'. */ +#undef HAVE_FP_EXCEPT_T + /* fp_trap is present */ #undef HAVE_FP_TRAP Index: libgfortran/configure =================================================================== --- libgfortran/configure (Revision 200359) +++ libgfortran/configure (Arbeitskopie) @@ -25977,7 +25977,28 @@ $as_echo "#define HAVE_FPSETMASK 1" >>confdefs.h fi +ac_fn_c_check_type "$LINENO" "fp_except" "ac_cv_type_fp_except" "#include +" +if test "x$ac_cv_type_fp_except" = x""yes; then : +cat >>confdefs.h <<_ACEOF +#define HAVE_FP_EXCEPT 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "fp_except_t" "ac_cv_type_fp_except_t" "#include +" +if test "x$ac_cv_type_fp_except_t" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_FP_EXCEPT_T 1 +_ACEOF + + +fi + + # Check for AIX fp_trap and fp_enable ac_fn_c_check_func "$LINENO" "fp_trap" "ac_cv_func_fp_trap" if test "x$ac_cv_func_fp_trap" = x""yes; then : Index: libgfortran/configure.ac =================================================================== --- libgfortran/configure.ac (Revision 200359) +++ libgfortran/configure.ac (Arbeitskopie) @@ -498,6 +498,7 @@ fi # Check for SysV fpsetmask LIBGFOR_CHECK_FPSETMASK +AC_CHECK_TYPES([fp_except,fp_except_t], [], [], [[#include ]]) # Check for AIX fp_trap and fp_enable AC_CHECK_FUNC([fp_trap],[have_fp_trap=yes AC_DEFINE([HAVE_FP_TRAP],[1],[fp_trap is present])])