Hi,

On Mon, Nov 19, 2012 at 04:35:45PM +0100, Michael Matz wrote:
> Hi,
> 
> On Mon, 19 Nov 2012, Steven Bosscher wrote:
> 
> > On Mon, Nov 19, 2012 at 2:10 PM, Michael Matz wrote:
> > > Hi,
> > >
> > > On Fri, 16 Nov 2012, Andrew Pinski wrote:
> > >
> > >> >> Ah, yes.  This one was amusing.  When we were drafting the proposal,
> > >> >> Lawrence kept wondering what this NOP_EXPR thing is.  I've been
> > >> >> suffering this name for so long, that it no longer irritates me.
> > >> >> Had it been named CAST_EXPR, or even NOP_CAST_EXPR, he would have
> > >> >> probably kept it in the example code :)
> > >> >
> > >> > We have CONVERT_EXPR, but it currently doesn't do _quite_ the same as
> > >> > NOP_EXPR.  I once wanted to merge them (with CONVERT_EXPR surviving),
> > >> > but it stalled somewhere, couple years ago.
> > >>
> > >> I think the only difference now is in the front-ends IIRC.
> > >
> > > No, because my patch didn't go in.  There are still various cases in the
> > > middle end that explicitely check for equality with NOP_EXPR, instead of
> > > using CONVERT_EXPR_P or CONVERT_EXPR_CODE_P or CASE_CONVERT to work with
> > > both.
> > >
> > > See the patch below from three years ago.  Of course it doesn't apply
> > > anymore, but I can update it if there's some consensus that we want to go
> > > that route.
> > 
> > At this point, you probably wanted to attach a patch :-)
> 
> I thought everybody can look into my head.  Well, if you can't 
> due to my aluminium hat, here it is electronically :)
> 

thanks, this way it's certainly easier to quote :-)

...

> Index: gcc/ipa-cp.c
> ===================================================================
> --- gcc.orig/ipa-cp.c 2009-08-17 10:53:09.000000000 +0200
> +++ gcc/ipa-cp.c      2009-09-29 15:29:05.000000000 +0200
> @@ -298,7 +298,7 @@ ipcp_lattice_from_jfunc (struct ipa_node
>       return;
>        cst = caller_lat->constant;
>  
> -      if (jfunc->value.pass_through.operation != NOP_EXPR)
> +      if (! CONVERT_EXPR_CODE_P (jfunc->value.pass_through.operation))
>       cst = fold_binary (jfunc->value.pass_through.operation,
>                          TREE_TYPE (cst), cst,
>                          jfunc->value.pass_through.operand);

This will of course work but it is a bit strange, jump functions do
not do any conversions, NOP_EXPR operation really means they do
nothing to the value they pass.  Similarly in ipa-prop.c.

Thanks,

Martin

Reply via email to