------- Comment #5 from dberlin at gcc dot gnu dot org  2006-10-22 17:39 -------
(In reply to comment #1)
> I think it's ok again, but it shows one weakness of the current NONLOCAL
> scheme:
> 
> foo ()
> {
>   struct Foo a;
>   int D.1534;
> 
> <bb 2>:
>   #   SFT.0_2 = V_MUST_DEF <SFT.0_1>;
>   a.i = 1;
>   #   SFT.0_6 = V_MAY_DEF <SFT.0_2>;
>   #   NONLOCAL.6_7 = V_MAY_DEF <NONLOCAL.6_5>;
>   bar (&a);
>   #   VUSE <SFT.0_6>;
>   D.1534_3 = a.i;
>   return D.1534_3;
> 
> }
> 
> we should see that &a points to a and so no NONLOCAL var is necessary
> here.
> 
The nonlocal variable is not necessary because it is unused elsewhere, *not*
because you only pass something pointing to a.  If we had globals here, they
could still be modified by the call to bar.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29551

Reply via email to