From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14595 invoked by alias); 30 Oct 2017 06:36:18 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 14151 invoked by uid 89); 30 Oct 2017 06:36:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-13.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: sonic308-10.consmr.mail.bf2.yahoo.com Received: from sonic308-10.consmr.mail.bf2.yahoo.com (HELO sonic308-10.consmr.mail.bf2.yahoo.com) (74.6.130.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 30 Oct 2017 06:36:03 +0000 Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.bf2.yahoo.com with HTTP; Mon, 30 Oct 2017 06:36:00 +0000 Received: from [127.0.0.1] by smtp227.mail.bf1.yahoo.com with NNFMP; 30 Oct 2017 06:35:57 -0000 X-Yahoo-SMTP: RNqztbyswBBFx6H5DU8E7igByQ1bWQP_Lw-- Message-ID: <1509345355.30471.9.camel@tuliptree.org> Subject: [PATCH] fix AIX fortran builds From: Jim Wilson To: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Date: Mon, 30 Oct 2017 06:36:00 -0000 Content-Type: multipart/mixed; boundary="=-R8yHsXaZ2sK9s3mzky8V" Mime-Version: 1.0 X-SW-Source: 2017-10/txt/msg00123.txt.bz2 --=-R8yHsXaZ2sK9s3mzky8V Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-length: 1334 A Power AIX build with fortran enabled fails in stage2, because longjmp is not declared noreturn in system header files. =C2=A0That is probably only true on systems where gcc is the system compiler, since this is a GCC extension. .../../gcc-git/gcc/fortran/parse.c: In function 'void unexpected_eof()': .../../gcc-git/gcc/fortran/parse.c:2740:1: error: 'noreturn' function does return [-Werror] =C2=A0} =C2=A0 ^ If I drop ATTRIBUTE_NORETURN on the unexpected_eof declaration, then I get 18 errors that look like this one. =C2=A0This is stage2 of a linux build. .../../gcc-svn/gcc/fortran/parse.c: In function =E2=80=98gfc_statement parse_spec(gfc_statement)=E2=80=99: .../../gcc-svn/gcc/fortran/parse.c:3745:22: error: this statement may fall through [-Werror=3Dimplicit-fallthrough=3D] =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0unexpected_eof (); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0~~~~~~~~~~~~~~~^~ .../../gcc-svn/gcc/fortran/parse.c:3747:5: note: here =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0case ST_IMPLICIT_NONE: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0^~~~ If I add a call to gcc_unreachable after the longjmp call, then it builds on both linux and AIX. =C2=A0Anyone have a better idea on how to fix this? =C2=A0If I don't get any responses in a few days, I will check it in under the obvious rule, since it fixes a build failure. Jim --=-R8yHsXaZ2sK9s3mzky8V Content-Type: text/x-patch; name="aix-fortran.patch"; charset="UTF-8" Content-Description: Content-Disposition: inline; filename="aix-fortran.patch" Content-Transfer-Encoding: 7bit Content-length: 505 2017-10-29 Jim Wilson gcc/fortran/ * parse.c (unexpected_eof): Call gcc_unreachable before return. Index: gcc/fortran/parse.c =================================================================== --- gcc/fortran/parse.c (revision 254210) +++ gcc/fortran/parse.c (working copy) @@ -2737,6 +2737,9 @@ unexpected_eof (void) gfc_done_2 (); longjmp (eof_buf, 1); + + /* Avoids build error on systems where longjmp is not declared noreturn. */ + gcc_unreachable (); } --=-R8yHsXaZ2sK9s3mzky8V--