From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claus Fischer To: dstarner98@aasaa.ofe.org Cc: gcc@gcc.gnu.org Subject: Re: type based aliasing again Date: Thu, 09 Sep 1999 16:24:00 -0000 Message-id: References: <19990909194801.A19896@x8b4e53cd.dhcp.okstate.edu> X-SW-Source: 1999-09/msg00379.html On Thu, 9 Sep 1999, David Starner wrote: [snip my stuff] : I don't like this. It's not reasonable to ask users to include : an 15 letter option whenever they invoke the compiler. [snip my stuff] : It's safer in someways, but it's wrong. We should be out to obsolete : this code, as it's wrong. The problem is that the anti-aliasing rules are an especially difficult and tricky part of the standard. If we demand that users know these rules that's akin to mandating having a copy of the standard. While helping people to learn is good, this is more like imposing difficulties on those that don't want to know. Amazingly while Fortran uses stricter rules it creates fewer problems to unexperienced programmers since the language somewhat avoids the mixture between direct and indirect access to a variable that is one of the problems in C in this respect (IMHO). : > 3 strict-aliasing [snip my stuff] : It's not subject to change between gcc releases anymore than anyother : part of the compiler. We should be encouraging this as a default. Probably people will develop ever more aggressive optimizations, exhausting more and more the ISO rules. --strict-aliasing should be understood as a carte blanche for the compiler to do that, that's what I wanted to say. : > 4 assume-unaliased [snip my stuff] : > I personally would love option 4. : So would I, in some form. After thinking about it, though, that's "restrict", : so that's already in the compiler, in a cleaner, more specific fashion. Yes; an entirely good thing, except it requires reading the documentation ;) and it's a major hassle to work around when writing basically ISO conforming code (ifdefs and such). So, some flag to do that on a per-file basis would still be a nice thing, say I put the 3% of my code that does matrix/vector operations into a file and tell the compiler to assume no aliasing for all that stuff. Claus -- claus.fischer@intel.com Intel Corporation SC12-205 ... not speaking phone +1-408-765-6808 2200 Mission College Blvd. for Intel fax +1-408-765-9322 Santa Clara, CA 95052-8119 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claus Fischer To: dstarner98@aasaa.ofe.org Cc: gcc@gcc.gnu.org Subject: Re: type based aliasing again Date: Thu, 30 Sep 1999 18:02:00 -0000 Message-ID: References: <19990909194801.A19896@x8b4e53cd.dhcp.okstate.edu> X-SW-Source: 1999-09n/msg00379.html Message-ID: <19990930180200.YO4hUMqsfCtqW2de7ICxDTxE8Egwzd-cqzL0alqaELg@z> On Thu, 9 Sep 1999, David Starner wrote: [snip my stuff] : I don't like this. It's not reasonable to ask users to include : an 15 letter option whenever they invoke the compiler. [snip my stuff] : It's safer in someways, but it's wrong. We should be out to obsolete : this code, as it's wrong. The problem is that the anti-aliasing rules are an especially difficult and tricky part of the standard. If we demand that users know these rules that's akin to mandating having a copy of the standard. While helping people to learn is good, this is more like imposing difficulties on those that don't want to know. Amazingly while Fortran uses stricter rules it creates fewer problems to unexperienced programmers since the language somewhat avoids the mixture between direct and indirect access to a variable that is one of the problems in C in this respect (IMHO). : > 3 strict-aliasing [snip my stuff] : It's not subject to change between gcc releases anymore than anyother : part of the compiler. We should be encouraging this as a default. Probably people will develop ever more aggressive optimizations, exhausting more and more the ISO rules. --strict-aliasing should be understood as a carte blanche for the compiler to do that, that's what I wanted to say. : > 4 assume-unaliased [snip my stuff] : > I personally would love option 4. : So would I, in some form. After thinking about it, though, that's "restrict", : so that's already in the compiler, in a cleaner, more specific fashion. Yes; an entirely good thing, except it requires reading the documentation ;) and it's a major hassle to work around when writing basically ISO conforming code (ifdefs and such). So, some flag to do that on a per-file basis would still be a nice thing, say I put the 3% of my code that does matrix/vector operations into a file and tell the compiler to assume no aliasing for all that stuff. Claus -- claus.fischer@intel.com Intel Corporation SC12-205 ... not speaking phone +1-408-765-6808 2200 Mission College Blvd. for Intel fax +1-408-765-9322 Santa Clara, CA 95052-8119