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] Enhanced nested functions lowering pass


> if we change your (nested) example to:
> int foo(void)
> {
>    int a = 0;
>    int b = 0;
>    int c;
>
>    void bar1 (void)
>    {
>      a = 1;
>    }
>
>    void bar2 (void)
>    {
>      b = 1;
>    }
>
>    a = a + 1;
>    bar2 ();
>    c = a + b;
>    bar1 ();
>    return c + b;
> }
>
> Your enhancement of nest lowering does nothing to improve
> this case which I would not doubt is more common in general in both
> Ada and Fortran (and maybe even Pascal) than you unused nested function
> example.

Please re-read the whole thing, the situation is precisely that bar1() is 
never invoked.  Changing the testcase to invoke bar1() voids your argument.

And, as I said in my first message, the situation is very common in Ada, just 
instantiate a package within a procedure.

-- 
Eric Botcazou


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