bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GLR: modification of $1


From: Frank Heckenbach
Subject: Re: GLR: modification of $1
Date: Sun, 5 Oct 2003 03:03:11 +0200
User-agent: semail 20030730

Paul Eggert wrote:

> Frank Heckenbach <address@hidden> writes:
> 
> > I see that each occurrence of $1 gets expanded to something like
> > `yyvsp[YYFILL (0)].yystate.yysemantics.yysval' where `YYFILL' is
> > #defined to `yyfill (...)'. I hope gcc will inline the function
> > calls in `-O3'
> 
> If it doesn't, please let us know.  We can add an 'inline' keyword
> or something (suitably ifdeffed).

With `-O3' it shouldn't matter, but it may be a good idea since
`-O2' is the default in many makefiles.

> > but are you sure it doesn't do any redundant work if $1 is used
> > several times in an action? (Or is that also considered bad style?)
> 
> What sort of redundant work did you have in mind?  There is a bit of
> redundant work in some cases, since it has to evaluate "!yynormal &&
> yylow1 < *yylow"; but it sounds like you're thinking of work beyond
> that.

I'm just referring to what yyfill does (especially when called
multiple times for multiple uses of $1). I don't know exactly what
GCC can optimize away, but I see that it uses pointers and the
address operator (in the call), and I've seen some less-than-perfect
GCC optimizations with such constructs in the past. Maybe this has
improved recently though, I don't know.

Frank

-- 
Frank Heckenbach, address@hidden
http://fjf.gnu.de/
GnuPG and PGP keys: http://fjf.gnu.de/plan (7977168E)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]