Re: Why C is much slower than Fortran

Robert Harley <harley@corton.inria.fr>
3 May 1999 14:45:20 -0400

          From comp.compilers

Related articles
Re: Why C is much slower than Fortran sokal@holyrood.ed.ac.uk (Daniel Barker) (1999-04-18)
Re: Why C is much slower than Fortran telken@sgi.com (Thomas Elken) (1999-04-29)
Re: Why C is much slower than Fortran sokal@holyrood.ed.ac.uk (Daniel Barker) (1999-04-30)
Re: Why C is much slower than Fortran harley@corton.inria.fr (Robert Harley) (1999-05-03)
Re: Why C is much slower than Fortran hrubin@stat.purdue.edu (1999-05-09)
Re: Why C is much slower than Fortran terryg@uswest.net (1999-05-16)
Re: Why C is much slower than Fortran gneuner@dyn.com (1999-05-16)
Re: Why C is much slower than Fortran reid@micro.ti.com (Reid Tatge) (1999-05-20)
Re: Why C is much slower than Fortran jhallen@world.std.com (1999-05-29)
Re: Why C is much slower than Fortran hwstock@wizard.com (H.W. Stockman) (1999-06-02)
[10 later articles]
| List of all articles for this month |

From: Robert Harley <harley@corton.inria.fr>
Newsgroups: comp.lang.c++,comp.compilers
Date: 3 May 1999 14:45:20 -0400
Organization: I.N.R.I.A Rocquencourt
References: <3710584B.1C0F05F5@hotmail.com> <7esvkr$v8g$1@camel29.mindspring.com> <37122569.BF79CD19@hotmail.com> <3712311D.BA9027D4@hotmail.com> <7etenl$nk5$1@alexander.INS.CWRU.Edu> 99-04-048 99-04-105 99-04-107
Keywords: C, performance

Our moderator wrote:


> C lets you alias anything to anything, and that does indeed cause
> optimization problems. The C9X draft has a "restrict" keyword [...]


But ANSI C has a rule which disallows aliasing anything to anything!


The rule is that an object in memory can only be accessed through
lvalues of the same type, possibly in a struct or union, or of char
type (here the types are considered modulo signed/unsigned and
qualifiers).


Presumably the "alias=typed" flag uses this rule to optimise better.


The restrict keyword can be used to give extra aliasing information,
even between objects of the same type where ANSI aliasing does not
help.




Bye,
    Rob.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.