complex<double>::norm() -- huge slowdown from egcs-2.91.66 to 3.0.3

Gabriel Dos Reis gdr@codesourcery.com
Wed Feb 20 09:17:00 GMT 2002


"Jeroen Nijhof" <Jeroen.Nijhof@marconi.com> writes:

[...]

| >Description:
| 
| gcc-3.0.3 (or rather  its libstdc++) generates code for complex<double>::norm
| which might be more accurate, but which is a lot slower than 're * re + im * im'.

I've been through this in the past, and it appears that there are
several factors contributing to the slowdon here.  The most important
factors being the weak treatment the middle end reserves to builtin
complex, and inlining ability. I posted a typical example of the
problems sometime ago, somewhere in the archive -- I'd have to go
through the archive. 

-- Gaby



More information about the Gcc-bugs mailing list