Branch: Tag:

2014-08-25

2014-08-25 09:33:39 by Per Hedbor <ph@opera.com>

Use __restrict with gcc on the pike_interpreter

This produces the same code as const, but avoids lying to the compiler.

Fixed an issue with gcc 3.4, which over-optimized a bit (specifically,
pip->stack_pointer was not re-read between function calls, which seems
odd given that it is not pip->stack_pointer that was const...)

59:    */   static struct Pike_interpreter_struct static_pike_interpreter;    - PMOD_EXPORT struct Pike_interpreter_struct *Pike_interpreter_pointer = -  &static_pike_interpreter; + PMOD_EXPORT struct Pike_interpreter_struct * + #if defined(__GNUC__) && __GNUC__ >= 3 +  __restrict + #endif + Pike_interpreter_pointer = &static_pike_interpreter;      PMOD_EXPORT struct Pike_interpreter_struct * pike_get_interpreter_pointer(void)   {