Replacing -O2 with -O3. ./benchmarks/jerry/loop_arithmetics_1kk.js: 2.97 -> 2.79.

This commit is contained in:
Ruben Ayrapetyan 2014-08-12 12:28:37 +04:00
parent b260f2458e
commit 701f03309a
2 changed files with 20 additions and 1 deletions

View File

@ -164,7 +164,7 @@ CFLAGS_WERROR ?= -Werror
CFLAGS_WFATAL_ERRORS ?= -Wfatal-errors
# Optimizations
CFLAGS_OPTIMIZE ?= -O2 -flto
CFLAGS_OPTIMIZE ?= -O3 -flto
CFLAGS_NO_OPTIMIZE ?= -O0
LDFLAGS_OPTIMIZE ?=
LDFLAGS_NO_OPTIMIZE ?=

View File

@ -37,6 +37,19 @@ extern void *memset(void *s, int c, size_t n);
*/
extern void *memmove(void *s1, const void*s2, size_t n);
#ifdef __GNUC__
/*
* Making GCC not to replace:
* - __memcpy -> call to memcpy;
* - __memset -> call to memset;
* - __memmove -> call to memmove.
*/
CALL_PRAGMA(GCC diagnostic push)
CALL_PRAGMA(GCC diagnostic ignored "-Wpragmas")
CALL_PRAGMA(GCC push_options)
CALL_PRAGMA(GCC optimize ("-fno-tree-loop-distribute-patterns"))
#endif /* __GNUC__ */
/**
* memcpy alias to __memcpy (for compiler usage)
*/
@ -66,6 +79,12 @@ void* memmove(void *s1, /**< destination*/
{
return __memmove(s1, s2, n);
} /* memmove */
#ifdef __GNUC__
CALL_PRAGMA(GCC pop_options)
CALL_PRAGMA(GCC diagnostic pop)
#endif /* __GNUC__ */
#endif /* LIBC_MUSL */
/**