http://d.puremagic.com/issues/show_bug.cgi?id=8536



--- Comment #3 from bearophile_h...@eml.cc 2012-08-10 19:49:18 PDT ---
(In reply to comment #1)

> This is a well known Optlink bug, though I don't have the bugzilla number
> handy.

OK.

> You're wrong about it impeding optimizations compared with dynamically
> allocating it, for a couple reasons:

This is a discussion better fit for the D newsgroup.

In attach there are 3 nearly identical C programs, that use a 2D global cache
matrix to perform a certain simple (but not stupid) computation.

The test0 uses a dynamically allocated "array" of pointers to "arrays". The
test1 uses a static array of dynamically allocated rows, and the test2 uses a
fully static 2D matrix. Compiling with GCC 4.7.1 with "-std=c99 -Ofast -flto
-s" the run-times are 6.52, 6.07 and 4.95 seconds. The more the GCC compiler
knows statically about the arrays, the more efficient binary it produces.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to