public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [Patch] Fix bogus 'function does return' warning
Date: Fri, 16 Oct 2009 10:38:00 -0000	[thread overview]
Message-ID: <84fc9c000910160326t3c5d1650p3ffd02b1c95b2101@mail.gmail.com> (raw)
In-Reply-To: <200910161155.29857.ebotcazou@adacore.com>

On Fri, Oct 16, 2009 at 11:55 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Huh.  I wonder why the unreachable blocks are not removed
>> after CFG build?  After all noreturn calls end BBs.
>
> It's -O0 so the compiler doesn't see that <L17> is unreachable:
>
> <L17>:
>  return;
>
> <L19>:
>  finally_tmp.10 = 1;
>  p.error (); [static-chain: &FRAME.8]
>  switch (finally_tmp.10) <default: <L17>, case 1: <L20>>

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 == (integer) R5b &&
VIEW_CONVERT_EXPR<character[1:1]>(*R3b.P_ARRAY) == "$")
          {
            .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.

  reply	other threads:[~2009-10-16 10:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-15 19:51 Eric Botcazou
2009-10-16  9:50 ` Richard Guenther
2009-10-16  9:55   ` Eric Botcazou
2009-10-16 10:38     ` Richard Guenther [this message]
2009-10-16 11:12       ` Eric Botcazou
2009-10-16 11:32         ` Richard Guenther
2009-10-16 13:21           ` Eric Botcazou
2009-10-17 10:26             ` Eric Botcazou
2009-10-17 11:29               ` Richard Guenther
2009-10-17 11:36                 ` Eric Botcazou
2009-10-17 14:12                   ` Richard Guenther
2009-10-17 17:00                     ` Richard Henderson
2009-10-17 17:10                       ` Richard Guenther
2009-10-18 15:49                         ` Eric Botcazou
2009-10-18 16:36                           ` Richard Henderson
2009-10-18 18:41                             ` Eric Botcazou
2009-10-19 15:39                               ` Richard Henderson
2009-10-19 17:32                                 ` Eric Botcazou
2009-10-19 18:30                                   ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84fc9c000910160326t3c5d1650p3ffd02b1c95b2101@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).