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] Avoid virtual operands for trigonometric builtins


On Wed, 2005-03-09 at 22:42 +0100, Zdenek Dvorak wrote:
> Hello,
> 
> here is the patch with the requested changes (bootstrapped & regtested
> again on i686).
> 
> Zdenek
> 
> 	* builtin-attrs.def (ATTR_NOVOPS, ATTR_NOVOPS_LIST,
> 	ATTR_PURE_NOTHROW_NOVOPS_LIST): New.
> 	* builtins.def (ATTR_MATHFN_FPROUNDING): Use NOVOPS.
> 	(BUILT_IN_PREFETCH): Set the NOVOPS attribute.
> 	* c-common.c (handle_novops_attribute): New function.
> 	(c_common_attribute_table): Add "no vops" entry.
> 	* c-decl.c (merge_decls): Copy DECL_IS_NOVOPS.
> 	* calls.c (flags_from_decl_or_type): Set ECF_NOVOPS.
> 	* tree-ssa-operands.c (get_call_expr_operands): Do not
> 	create virtual operands for calls with ECF_NOVOPS flag.
> 	* tree.h (DECL_IS_NOVOPS): New macro.
> 	(struct tree_decl): Add novops_flag.
> 	(ECF_NOVOPS): New constant.
Basically OK.  Minor nits:

> *************** struct tree_decl GTY(())
> *** 2359,2364 ****
> --- 2364,2370 ----
>     unsigned no_limit_stack : 1;
>     ENUM_BITFIELD(built_in_class) built_in_class : 2;
>     unsigned pure_flag : 1;
> +   unsigned novops_flag : 1;
>   
>     unsigned non_addressable : 1;
>     unsigned user_align : 1;
> *************** struct tree_decl GTY(())
> *** 2383,2389 ****
>     unsigned gimple_formal_temp : 1;
>     unsigned debug_expr_is_from : 1;
>     unsigned returns_twice_flag : 1;
> !   /* 11 unused bits.  */
>   
>     union tree_decl_u1 {
>       /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
> --- 2389,2395 ----
>     unsigned gimple_formal_temp : 1;
>     unsigned debug_expr_is_from : 1;
>     unsigned returns_twice_flag : 1;
> !   /* 10 unused bits.  */
Please put the new flag bit at the end of list of bitflags.

It's also the case that the count of free bits is wrong,
there were 10 free bits before your change and only 9 after.
This group uses 9 bits, not 8 like the other groups, which
is probably how our count got mucked up in the first place:

  unsigned non_addressable : 1;
  unsigned user_align : 1;
  unsigned uninlinable : 1;
  unsigned thread_local_flag : 1;
  unsigned declared_inline_flag : 1;
  unsigned seen_in_bind_expr : 1;
  ENUM_BITFIELD(symbol_visibility) visibility : 2;
  unsigned visibility_specified : 1;


So can you update the comment to indicate that there are
only 9 unused bits.  If you wanted, I would also love to
see one of the bit flags from the group of 9 moved to
the end of the list of bitflags so that each group has
8 bits in it -- which makes it easier to verify that
we're counting the bits correctly.  If you want to do
that in a separate patch, that's fine and it's pre-approved.

jeff



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