From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21742 invoked by alias); 16 Oct 2009 10:26:13 -0000 Received: (qmail 21734 invoked by uid 22791); 16 Oct 2009 10:26:13 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-vw0-f178.google.com (HELO mail-vw0-f178.google.com) (209.85.212.178) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Oct 2009 10:26:10 +0000 Received: by vws8 with SMTP id 8so1209639vws.0 for ; Fri, 16 Oct 2009 03:26:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.42.11 with SMTP id q11mr2777872vce.88.1255688768450; Fri, 16 Oct 2009 03:26:08 -0700 (PDT) In-Reply-To: <200910161155.29857.ebotcazou@adacore.com> References: <200910152148.53899.ebotcazou@adacore.com> <84fc9c000910160244l6e38fdc9ga9063d8a047e58bb@mail.gmail.com> <200910161155.29857.ebotcazou@adacore.com> Date: Fri, 16 Oct 2009 10:38:00 -0000 Message-ID: <84fc9c000910160326t3c5d1650p3ffd02b1c95b2101@mail.gmail.com> Subject: Re: [Patch] Fix bogus 'function does return' warning From: Richard Guenther To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg01044.txt.bz2 On Fri, Oct 16, 2009 at 11:55 AM, Eric Botcazou wro= te: >> Huh. =A0I wonder why the unreachable blocks are not removed >> after CFG build? =A0After all noreturn calls end BBs. > > It's -O0 so the compiler doesn't see that is unreachable: > > : > =A0return; > > : > =A0finally_tmp.10 =3D 1; > =A0p.error (); [static-chain: &FRAME.8] > =A0switch (finally_tmp.10) , case 1: > Ok, so we get lucky at -O1 because decide_copy_try_finally decides to copy the finally region. Thus the real reason for the warning is the return in if ((integer) R6b =3D=3D (integer) R5b && VIEW_CONVERT_EXPR(*R3b.P_ARRAY) =3D=3D "$") { .gnat_rcheck_20 ("noreturn1.adb", 9); } else { .gnat_rcheck_04 ("noreturn1.adb", 11); } return; or that .gnat_rcheck_* can appearantly throw (or instead that EH lowering adds EH edges to the finally block even though that the functions cannot return). So, can they throw or is EH lowering at fault here? Richard.