Re: HardBound and SoftBound
- From: Mayan Moudgill <mayan@xxxxxxxxxxx>
- Date: Thu, 20 Aug 2009 07:24:09 -0400
Wilco Dijkstra wrote:
"Mayan Moudgill" <mayan@xxxxxxxxxxx> wrote in message news:U5qdnUdy-e-eLhHXnZ2dnUVZ_rWdnZ2d@xxxxxxxxxxxxxx
compiling the following program with gcc 3.4.4 using the command line
gcc -O2 -std=c99
You can also get the same surprising (to you) result on xlc on AIX.
I find this hard to believe, if this is true then it will break a working program
due to instruction scheduling alone. Anyway good luck with it, you need it!
Wilco
It may be difficult to believe, but most (if not all) the so-called "professional" compilers out there actually support gcc's view of ansi aliasing. I know for a fact that IBM's xlc does at optimization level -O2. I double checked and found the relevant flags for HP, Sun and Intel, as well.
I found a very good explanation of possible alias models and the one defined for ISO standard C on:
http://docs.sun.com/app/docs/doc/819-5265/bjaji?a=view
Focus on the implications of using the -xalias_level=std (i.e. the ISO C type based aliasing model).
Now, like I said, I expect that you will get the same interesting behavior from IBM using xlc -O2. You can peruse the xlc online documentation for -qalias or the -qansialias options
For HP: hmmm, it looks like the correct invocation is
acc -Otype_safety=ansi
For Sun, the flags should be -xO3 -xalias_level=std
For Intel's compiler, the flag is probably -O2 -ansi-alias (or /O2 /Qansi-alias on windows systems).
You may need to split the two functions up into two files to inhibit inlining with some of these compilers.
Oh, and try compiling with all optimizations off as well.
.
- Follow-Ups:
- Re: HardBound and SoftBound
- From: Wilco Dijkstra
- Re: HardBound and SoftBound
- From: Rob Warnock
- Re: HardBound and SoftBound
- References:
- HardBound and SoftBound (was "The State of Software")
- From: Andy \"Krazy\" Glew
- Re: HardBound and SoftBound
- From: Andy \"Krazy\" Glew
- Re: HardBound and SoftBound
- From: nmm1
- Re: HardBound and SoftBound
- From: Mayan Moudgill
- Re: HardBound and SoftBound
- From: nmm1
- Re: HardBound and SoftBound
- From: Wilco Dijkstra
- Re: HardBound and SoftBound
- From: Mayan Moudgill
- Re: HardBound and SoftBound
- From: Wilco Dijkstra
- Re: HardBound and SoftBound
- From: Mayan Moudgill
- Re: HardBound and SoftBound
- From: Wilco Dijkstra
- Re: HardBound and SoftBound
- From: Mayan Moudgill
- Re: HardBound and SoftBound
- From: Wilco Dijkstra
- Re: HardBound and SoftBound
- From: Mayan Moudgill
- Re: HardBound and SoftBound
- From: Wilco Dijkstra
- HardBound and SoftBound (was "The State of Software")
- Prev by Date: Re: HardBound and SoftBound
- Next by Date: Re: HardBound and SoftBound
- Previous by thread: Re: HardBound and SoftBound
- Next by thread: Re: HardBound and SoftBound
- Index(es):
Relevant Pages
|