This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] ccp for V_MUST_DEF operands
On Fri, 2004-07-16 at 11:21, Diego Novillo wrote:
> On Fri, 2004-07-16 at 10:26, Brian Booth wrote:
> > On Thu, 2004-07-15 at 09:18, Diego Novillo wrote:
> > > Could you add a test case? Something like this should suffice:
> > >
> > > --
> > > int G;
> > >
> > > foo (int i)
> > > {
> > > if (i > 0)
> > > G = 3;
> > > else
> > > G = 3;
> > > if (G != 3)
> > > link_error ();
> > > }
> > >
> > > main ()
> > > {
> > > foo (0);
> > > return 0;
> > > }
> > > --
> >
> > I'm withdrawing this patch for the time being because it does not
> > propagate G in the testcase above. The problem has to do with performing
> > a meet operation on UNKNOWN_VAL. More specifically, the case CONSTANT M
> > UNKNOWN_VAL = VARYING is causing G not to be propagated since the PHI
> > node for G is simulated before one of the assignments to G in the
> > if-else block. This is causing the PHI node to be marked as VARYING and
> > ensures that it is not simulated again.
> >
> What about initially setting phi_val to UNDEFINED if
> get_value (PHI_RESULT (phi)) returns UNKNOWN_VAL?
That's exactly what I'm working on right now. We just have to be careful
as to avoid a UNKNOWN_VAL->UNDEFINED state transition inadvertently
being saved because of this.
Brian