This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/29551] FAIL: gcc.dg/tree-ssa/pr26421.c scan-tree-dump-times V_MAY_DEF 1
- From: "dberlin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Oct 2006 17:39:02 -0000
- Subject: [Bug tree-optimization/29551] FAIL: gcc.dg/tree-ssa/pr26421.c scan-tree-dump-times V_MAY_DEF 1
- References: <bug-29551-276@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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