Message from discussion Why C is much slower than Fortran
From: Robert Harley <har...@corton.inria.fr>
Subject: Re: Why C is much slower than Fortran
References: <3710584B.1C0F05F5@hotmail.com> <firstname.lastname@example.org> <37122569.BF79CD19@hotmail.com> <3712311D.BA9027D4@hotmail.com> <7etenl$nk5$1@alexander.INS.CWRU.Edu> <email@example.com> <firstname.lastname@example.org> <email@example.com>
Organization: I.N.R.I.A Rocquencourt
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
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