This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Make attribute functions pure
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: paul at codesourcery dot com
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Fri, 23 Jul 04 08:55:54 EDT
- Subject: Re: [PATCH] Make attribute functions pure
> Does doing that make it impure? I don't see how and would like an
> example of how that can cause miscompilations.
As you describe it, no. However if you store the inputs, outputs and *any
global variables it or its children look at* in *static local* variables,
that should be ok.
All you have to do is define the usage of the function so that nothing
is permitted to depend on anything it sets in global memory.
recog_memoized certainly meets that requirement.
So I don't see what's wrong with this patch.