By: Michael S (already5chosen.delete@this.yahoo.com), July 18, 2013 7:10 am
Room: Moderated Discussions
none (none.delete@this.none.com) on July 18, 2013 7:47 am wrote:
> Michael S (already5chosen.delete@this.yahoo.com) on July 18, 2013 6:44 am wrote:
> >
> > I hope they don't.
> > gcc -O3 is way to aggressive to be a default.
> > For default I'd take something like "-O2 -fno-strict-aliasing".
>
> Indeed. I was not preaching for -O3, but -Os certainly stinks a
> lot. I'd like the Thumb flags to be the same as the ARM ones.
>
> Why would you want no strict aliasing?
First, because it has potential to break legacy code. It's especially offending because quite often problems arise in 3-rd party (source-code) libraries and then poor library user is in a deep shit.
Second, because it almost never helps performance of well programs (read, mine :-) ) and I feel that optimizations that help badly written programs to run closer to well-written programs are morally wrong :(
Third, because even when it does not break things, it (I am talking about gcc implementation) tends to produce annoying warnings.
Fourth, because I think that the whole idea is silly and that C99 committee was wrong in the first place. The philosophy of the C language, mostly followed by C90, makes no connection between types and aliasing properties and that (absence of connection) makes a perfect sense. If C99 committee wanted to add tools for carrying aliasing information from programmer to compiler (which is certainly a worthy goal), then they should have provided new constructs for that (restrict is a step in right direction) instead of hijacking existing tool that has completely different purpose.
> Michael S (already5chosen.delete@this.yahoo.com) on July 18, 2013 6:44 am wrote:
> >
> > I hope they don't.
> > gcc -O3 is way to aggressive to be a default.
> > For default I'd take something like "-O2 -fno-strict-aliasing".
>
> Indeed. I was not preaching for -O3, but -Os certainly stinks a
> lot. I'd like the Thumb flags to be the same as the ARM ones.
>
> Why would you want no strict aliasing?
First, because it has potential to break legacy code. It's especially offending because quite often problems arise in 3-rd party (source-code) libraries and then poor library user is in a deep shit.
Second, because it almost never helps performance of well programs (read, mine :-) ) and I feel that optimizations that help badly written programs to run closer to well-written programs are morally wrong :(
Third, because even when it does not break things, it (I am talking about gcc implementation) tends to produce annoying warnings.
Fourth, because I think that the whole idea is silly and that C99 committee was wrong in the first place. The philosophy of the C language, mostly followed by C90, makes no connection between types and aliasing properties and that (absence of connection) makes a perfect sense. If C99 committee wanted to add tools for carrying aliasing information from programmer to compiler (which is certainly a worthy goal), then they should have provided new constructs for that (restrict is a step in right direction) instead of hijacking existing tool that has completely different purpose.