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]

Re: New function attribute "pure"


On Mon, Apr 10, 2000 at 12:49:18AM +0200, Jan Hubicka wrote:
> 	* tree.h (DECL_IS_PURE): New macro.
> 	(struct tree_decl): Add pure_flag.
> 	* c-common.c (enum attrs): Add attribute "pure".
> 	(init_attributes): Initialize attribute "pure"
> 	(decl_attributes): Handle attribute "pure".
> 	* extend.texi (Attribute "pure"): Document.
> 	* calls.c (expand_call): Add (mem:BLK (scratch)) to "equal from"
> 	in pure function.
> 	(flags_from_decl_or_type): Support attribute "pure".

Ok.

>     unsigned malloc_flag : 1;
>     unsigned no_limit_stack : 1;
> +   unsigned pure_flag : 1;

Just musing for future cleanup:

Backends recognize attributes via lookup_attribute.  I wonder if
we shouldn't do the same with some of these, so that we do not
keep bloating the DECL.

In this case it probably makes things nastier when it comes to
collecting information about functions we've compiled.  But we
will never intuit anything about malloc or stack limits or ...

> + 	    warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
> + 	  break;
> + 
>   
>   	case A_T_UNION:

Careful with extra newlines.

> + The attribute @code{const} is not implemented in GNU C versions earlier
> + than 2.96.

That should be `pure' not `const'.



r~

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