This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][4/n] Merge from match-and-simplify, hook into fold-const.c
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Sebastian Pop <sebpop at gmail dot com>
- Cc: Richard Biener <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 16 Oct 2014 21:14:18 +0200
- Subject: Re: [PATCH][4/n] Merge from match-and-simplify, hook into fold-const.c
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1410151352510 dot 20733 at zhemvz dot fhfr dot qr> <20141016185825 dot GA29134 at f1 dot c dot bardezibar dot internal>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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.
Jakub