Author Message

        I was reading through some article and noticed a mention of aliasing
and optimization problems.  Having no idea what aliasing was, I tried finding
it in the pseudo-programmer's manual; not being satisfied with the answer (as
I expected) I seek the guru's answers.

        Aliasing: referring to more than one memory location by two different
names.  Some compilers can preform special optimization if you ignore aliasing
checking.  "Safe" aliasing would consist of the following:

            int x, *p = &x;

            /* ...only *p is used in the remainder of the function... */

Here, aliasing optimization would be preformed without hazardous results. An
example of unsafe optimization would be:

        int x;
        int *p;
            /* expressions involving *p and x */

Which, if nothing else, would seem asinine to do.  Is this much of my
understanding correct?  I think it is, but I'm foggy on it, to say the least.

        And what about the "noalias" keyword that may or may not (?) be
adopted by XJ311?  Of what use would that be?

Sun, 17 Jan 1993 19:18:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Aliasing through union, C++ vs. C

2. ANSI aliasing rules

3. Aliasing question...

4. Aliasing in ANSI C

5. Aliasing and character types

6. Sequence Points, Aliasing & Optimisation

7. difference between punning and aliasing

8. aliasing single quotes in macros

9. aliasing quotes in macros?

10. difference between punning and aliasing

11. anti aliasing filter source

12. aliasing


Powered by phpBB® Forum Software