public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* g++ V3.3.1 not faster with __restrict
@ 2003-11-21 10:26 Kaspar Thommen
  2003-11-21 10:42 ` Falk Hueffner
  0 siblings, 1 reply; 2+ messages in thread
From: Kaspar Thommen @ 2003-11-21 10:26 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 895 bytes --]

Hi,

I ran some benchmarks using g++ V3.3.1. Two functions are called from a main
program. While both doing exactly the same array manipulation (dot product
on doubles), one of the functions uses the __restrict keyword to tell the
compiler that pointer aliasing is "turned off" in that function.

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?
Didn't find anything in the docs however. I tried using -o, -o2, -o3, giving
always equal speed for both functions.

Regards
Kaspar

-- 
GMX Weihnachts-Special: Seychellen-Traumreise zu gewinnen!

Rentier entlaufen. Finden Sie Rudolph! Als Belohnung winken
tolle Preise. http://www.gmx.net/de/cgi/specialmail/

+++ GMX - die erste Adresse für Mail, Message, More! +++

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: g++ V3.3.1 not faster with __restrict
  2003-11-21 10:26 g++ V3.3.1 not faster with __restrict Kaspar Thommen
@ 2003-11-21 10:42 ` Falk Hueffner
  0 siblings, 0 replies; 2+ messages in thread
From: Falk Hueffner @ 2003-11-21 10:42 UTC (permalink / raw)
  To: Kaspar Thommen; +Cc: gcc-help

"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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-11-21 10:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-21 10:26 g++ V3.3.1 not faster with __restrict Kaspar Thommen
2003-11-21 10:42 ` Falk Hueffner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).