This is the mail archive of the gcc@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] 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.


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