Disable "bad" optimisations only for emulation loop

This commit is contained in:
Dmitry Stogov 2019-05-30 20:35:30 +03:00
parent 2ba9177d4f
commit ee56552913
3 changed files with 16 additions and 10 deletions

View file

@ -4437,18 +4437,8 @@ static zend_never_inline int ZEND_FASTCALL zend_quick_check_constant(
} \ } \
} while (0) } while (0)
#if ZEND_GCC_VERSION >= 4000 && !defined(__clang__)
# pragma GCC push_options
# pragma GCC optimize("no-gcse")
# pragma GCC optimize("no-ivopts")
#endif
#include "zend_vm_execute.h" #include "zend_vm_execute.h"
#if ZEND_GCC_VERSION >= 4000 && !defined(__clang__)
# pragma GCC pop_options
#endif
ZEND_API int zend_set_user_opcode_handler(zend_uchar opcode, user_opcode_handler_t handler) ZEND_API int zend_set_user_opcode_handler(zend_uchar opcode, user_opcode_handler_t handler)
{ {
if (opcode != ZEND_USER_OPCODE) { if (opcode != ZEND_USER_OPCODE) {

View file

@ -54854,6 +54854,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NULL_HANDLER(ZEND_OPCODE_HANDL
#endif #endif
#if (ZEND_VM_KIND != ZEND_VM_KIND_CALL) && (ZEND_GCC_VERSION >= 4000) && !defined(__clang__)
# pragma GCC push_options
# pragma GCC optimize("no-gcse")
# pragma GCC optimize("no-ivopts")
#endif
ZEND_API void execute_ex(zend_execute_data *ex) ZEND_API void execute_ex(zend_execute_data *ex)
{ {
DCL_OPLINE DCL_OPLINE
@ -65700,6 +65705,9 @@ zend_leave_helper_SPEC_LABEL:
} }
zend_error_noreturn(E_CORE_ERROR, "Arrived at end of main loop which shouldn't happen"); zend_error_noreturn(E_CORE_ERROR, "Arrived at end of main loop which shouldn't happen");
} }
#if (ZEND_VM_KIND != ZEND_VM_KIND_CALL) && (ZEND_GCC_VERSION >= 4000) && !defined(__clang__)
# pragma GCC pop_options
#endif
ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value) ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value)
{ {

View file

@ -1,5 +1,10 @@
{%DEFINES%} {%DEFINES%}
#if (ZEND_VM_KIND != ZEND_VM_KIND_CALL) && (ZEND_GCC_VERSION >= 4000) && !defined(__clang__)
# pragma GCC push_options
# pragma GCC optimize("no-gcse")
# pragma GCC optimize("no-ivopts")
#endif
ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *ex) ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *ex)
{ {
DCL_OPLINE DCL_OPLINE
@ -20,6 +25,9 @@ ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *ex)
} }
zend_error_noreturn(E_CORE_ERROR, "Arrived at end of main loop which shouldn't happen"); zend_error_noreturn(E_CORE_ERROR, "Arrived at end of main loop which shouldn't happen");
} }
#if (ZEND_VM_KIND != ZEND_VM_KIND_CALL) && (ZEND_GCC_VERSION >= 4000) && !defined(__clang__)
# pragma GCC pop_options
#endif
ZEND_API void zend_{%EXECUTOR_NAME%}(zend_op_array *op_array, zval *return_value) ZEND_API void zend_{%EXECUTOR_NAME%}(zend_op_array *op_array, zval *return_value)
{ {