g++ V3.3.1 not faster with __restrict

Falk Hueffner falk.hueffner@student.uni-tuebingen.de
Fri Nov 21 10:42:00 GMT 2003


"Kaspar Thommen" <kaspar@gmx.ch> writes:

> To my surprise, the __restrict version is not faster than the conventional
> one. In fact, they show the same speed. Do I have to specify any compilation
> option to tell g++ to really take advantage from the __restrict information?

No, although probably -O2 is required to show any difference.

> Didn't find anything in the docs however. I tried using -o, -o2,
> -o3, giving always equal speed for both functions.

Try -funroll-loops or -funroll-all-loops, this produces more
possibilities to take advantage of the non-aliasing.

-- 
	Falk



More information about the Gcc-help mailing list