This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Fix bogus 'function does return' warning


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]