This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][4/n] Merge from match-and-simplify, hook into fold-const.c


On Thu, Oct 16, 2014 at 09:14:18PM +0200, Jakub Jelinek wrote:
> On Thu, Oct 16, 2014 at 06:58:25PM +0000, Sebastian Pop wrote:
> > Richard Biener wrote:
> > > To give you an example how it looks like, the following code is
> > > generated for
> > > 
> > > /* fold_negate_exprs convert - (~A) to A + 1.  */
> > > (simplify
> > >  (negate (bit_not @0))
> > >  (if (INTEGRAL_TYPE_P (type))
> > >   (plus @0 { build_int_cst (TREE_TYPE (@0), 1); } )))
> > > 
> > > tree
> > > generic_simplify (enum tree_code code, tree type ATTRIBUTE_UNUSED, tree op0)
> > 
> > I wonder why ATTRIBUTE_UNUSED is generated for used parameters.
> 
> Generally, if an argument is never used (but desirable anyway), we shouldn't
> name it, if it is conditionally used (e.g. used by some macros that might
> or might not use the argument in the end), then ATTRIBUTE_USED should be
> used.  Haven't checked which case is this.

Well, I think part of the reason is the autogeneratedness of the code,
its just easier to make the codegen not worry about how many are
actually used, and fwiw gengtype does the same sort of thing.

Trev

> 
> 	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]