This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: type based aliasing again
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: type based aliasing again
- From: Nathan Sidwell <nathan at acm dot org>
- Date: Wed, 15 Sep 1999 16:56:14 +0100
- CC: dje at watson dot ibm dot com, toon at moene dot indiv dot nluug dot nl, N8TM at aol dot com, craig at jcb-sc dot com, espie at quatramaran dot ens dot fr, gcc at gcc dot gnu dot org, mark at codesourcery dot com, nik at tiuk dot ti dot com, richard dot earnshaw at arm dot com
- References: <199909151527.LAA25557@caip.rutgers.edu>
- Reply-To: nathan at compsci dot bristol dot ac dot uk
"Kaveh R. Ghazi" wrote:
> I have concerns about removing strict aliasing from -O2.
>
> Most users probably use -O2 simply because that's what most people
> have learned do, e.g. because autoconf defaults to when -O2 you build
> a package. So I think that strict aliasing will get much less usage
> even when it is safe to use it.
Good point, but what if we persuaded the autoconf maintainers to make
the next autoconf release emit -O3? (And gcc then did -fstrict-aliasing
at -O3, not at -O2). Non-maintained packages wouldn't upgrade autoconf
and thus remain at -O2, whereas maintained packages would (presumably)
upgrade autoconf and, if they broke the aliasing rules would then break.
The maintainer would see things compiled at -O3, not -O2 and (hopefully)
think 'Mmm, I wonder what -O3 means'. Similarly, users of autoconf would
see the same difference in their own (unreleased) code.
The trouble with this approach, is what about the next "ISO conformant
optimization that breaks a bogus assumption people make"? The approach
doesn't scale. I suppose we could amend the above to have autoconf emit
`-O2 -strict-aliasing'. (That might be an even bigger clue!)
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
I have seen the death of PhotoShop -- it is called GIMP
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk