lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Eero Pajarre wrote:

In any case, I will check again because of your results.


Maybe the most interesting result so far is that with my
normal compilation options (which I use with Microsoft
compiler) the 4.5 Intel compiler generates incorrect
code. The options include /Oa (assume no aliasing) so
I cannot say for sure should this be called a compiler bug.
(It is possibly a documentation bug, because the docs claim
that this option is ignored by the compiler... )

The problematic code is in f_luaopen (lstate.c)

  defaultmeta(L)->tt = LUA_TTABLE;
  sethvalue(defaultmeta(L), luaH_new(L, 0, 4));
  hvalue(defaultmeta(L))->metatable = hvalue(defaultmeta(L));

In generated code the compiler reorders the instructions so much,
that it does not write the result of luaF_new into memory
before it uses that value on the next line...

When compiled without /Oa and Intel compiler my application
on whole does not run noticeably faster than when compiled
with the Microsoft compiler. (actually it is little slower)


		Eero