Greetings!

Gabriel Dos Reis <[EMAIL PROTECTED]> writes:

> On Fri, 2 Mar 2007, Camm Maguire wrote:
> 
> | > | C99 language semantics now assume that pointers to different types
> | > | point to different memory locations, which is obvious nonsense, but
> | > | part of the new standard.
> | >
> | > That statement is obviously untrue.
> | >
> | > The non-aliasing rule, which has always been there since I don't know
> | > when -- certainly, it is part of C89, and it is not a C99 invention --
> | > says that the following is undefined behaviour
> | >
> | >       double z;
> | >       *(long*)&z = 1;
> | >       printf ("%g", z);
> | >
> | > That makes perfect sense.  Why would you think it is nonsense?
> | >
> | > | You might want to add -fno-strict-aliasing option to the GCC command 
> line.
> | >
> | > Instead of papering over the incorrectness, I would suggest to fix it.
> | >
> |
> | Agreed.
> 
> Interestingly, ECL -- another CL implementation with KCL as
> grandfather -- invokes GCC explicitly with -fstrict-aliasing, e.g. it
> is explicitly askign the compiler to exploit aliasing rules, when
> compiling generated C codes.
> 

Great!  Isn't this enabled by -O2 and higher anyway:

     `-O2' turns on all optimization flags specified by `-O'.  It also
     turns on the following optimization flags:
          -fforce-mem
          -foptimize-sibling-calls
          -fstrength-reduce
          -fcse-follow-jumps  -fcse-skip-blocks
          -frerun-cse-after-loop  -frerun-loop-opt
          -fgcse   -fgcse-lm   -fgcse-sm
          -fdelete-null-pointer-checks
          -fexpensive-optimizations
          -fregmove
          -fschedule-insns  -fschedule-insns2
          -fsched-interblock -fsched-spec
          -fcaller-saves
          -fpeephole2
          -freorder-blocks  -freorder-functions
          -fstrict-aliasing
          -falign-functions  -falign-jumps
          -falign-loops  -falign-labels


Still can't reproduce any aliasing warnings with gcl 2.6.8pre and gcc
4.1.2.  Could someone please tell me what I'm missing?

Take care,

> -- Gaby
> 
> 
> 

-- 
Camm Maguire                                            [EMAIL PROTECTED]
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah


_______________________________________________
Gcl-devel mailing list
Gcl-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/gcl-devel

Reply via email to